I have a text in a textarea and I read it out using the .value attribute.
Now I would like to remove all linebreaks (the character that is produced when you press
A linebreak in regex is \n, so your script would be
var test = 'this\nis\na\ntest\nwith\newlines'; console.log(test.replace(/\n/g, ' '));