Is there a way to remove the blank lines from a string?
For example
line1
line2
line3
line5
Would return:
line1
line2
line3
line5
I have tried the following:
var textTrimmed = textUntrimmed.responseText.replace(/\n/g, '')
But that seems to remove ALL the lines, so it would return:
line1line2line3line5
Any help would be greatly appeciated.
For example
line1
line2
line3
line5
Would return:
line1
line2
line3
line5
I have tried the following:
var textTrimmed = textUntrimmed.responseText.replace(/\n/g, '')
But that seems to remove ALL the lines, so it would return:
line1line2line3line5
Any help would be greatly appeciated.