In javascript, If i have a text block like so
Line 1
Line 2
Line 3
What would i need to do to lets say delete the first line and turn it in
You can do this with regex by including the newline character in your search. If the line you want to remove is not at the beginning, you must use the multiline (m) flag.
> var text = "Line 1\nLine 2\nLine 3";
> console.log(text);
Line 1
Line 2
Line 3
> text.replace(/^Line 1\n/m, "");
Line 2
Line 3
> text.replace(/^Line 2\n/m, "");
Line 1
Line 3