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
Math,
6 months ago
Math,
6 months ago
Computer Science,
6 months ago
History,
1 year ago
Sociology,
1 year ago