SyntaxFix
Write A Post
Hire A Developer
Questions
You can also replace without a regular expression.
while(str.indexOf(' ')!=-1)str.replace(' ',' ');