Computer Science, asked by kajayasmeen3074, 1 year ago

How can I replace newlines with spaces in JavaScript?

Answers

Answered by VeronicaVkhokhar
0

by using back slash n you can do it

Answered by sardhik
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