Laman

Javascript: Remove Line Break and Double Spacing

For remove break line use:  text.replace(/(\r\n|\n|\r)/gm," ");
For remove double spacing use:  text.replace(/\s{2,}/g, ' ');

Sample code:




Demo:


No comments:

Post a Comment

Silahkan