I want to replace all occurrences of white space characters (space, tab, newline) in JavaScript. How to do so?
I tried:
str.replace(/ /gi, \"X\
Have you tried the \s?
\s
str.replace(/\s/g, "X");