I am trying to replace all occurrences of line breaks to html line breaks in my string, but it is only converting the first one found
var output= "";
string x = "Hi\nMy name is x\nAnd age is 10\n";
output = x
output = output.replace("\\n", "<br>")
Output =
Hi
My name is x\nAnd age is 10\n
`... – Jarod42 Feb 17 '21 at 14:47
")` – eyllanesc Oct 31 '21 at 10:15