I am trying to split a string by newline character (\n) but it removes the last character from the string. How do I rectify this?
I have tried replacing the newline character with a pair of the same then splitting .. but not working.
var lines = str.split("\n");
The screenshot shows the difference between the raw array which I use to get the string at the console and the display in the table. As indicated by the marks, the last letters are missing:
Copyright Notice:Content Author:「Denn」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58504009/splitting-a-string-by-newline-character-succeeds-but-removes-the-last-character