How can I replace newlines with spaces in JavaScript?
Answers
Answered by
0
by using back slash n you can do it
Answered by
0
Well, You can use System.getProperty("line.terminator") to get the line break in any OS and by using String replace() method, you can replace all line breaks with any character e.g. white space. replace() method from java.lang.String class also supports regular expressions, which makes it even more powerful.
Similar questions