javascript convert tab spaces into \t keep two \t together code example Example: replace multiple spaces with single space javascript string = string.replace(/\s\s+/g, ' ');