SyntaxFix
Write A Post
Hire A Developer
Questions
If you use
str.replace(/\s/g, "");
it replaces all whitespaces. For example:
var str = "hello my world"; str.replace(/\s/g, "") //the result will be "hellomyworld"