I have a string like this:
NSString* text = @" Line 1 \n Line 2 \n Line 3 ";
and I have to trim only the spaces of the end of each line, like this:
text = @" Line 1\n Line 2\n Line 3";
How can I do this using regular expression?
This question is not duplicated because the other posts removes only the spaces at the end of the string, not at the end of each line of the same string, and it is using regex.