I have a string like so:
var aString = "This is a string \n\n This is the second line of the string\n\n"
Which inside a textview looks like so:
This is a string
This is the second line of the string
// 2 extra lines of unnecessary white space
But i want it to look like this:
This is a string
This is the second line of the string
I want to remove all "\n" from the end of the string and remove \n where it repeats itself so theres no white space in the middle.
ideally, I'm guessing the end result should be this:
var aString = "This is a string \n This is the second line of the string"