I have this string, it looks like this
1.2.3.4 sometext
9.8.7.6 othertext
5.6.7.8 moretext
sometext has a space before new line and moretext has a tab at the end (and maybe a new line)
I need to remove white space only at end of each line but excluding new line char.
here is what I have
output = "1.2.3.4 sometext \r\n9.8.7.6 othertext\r\n5.6.7.8 moretext\t";
output = Regex.Replace(output, @"^\s+|\s+$", "", RegexOptions.Multiline);
this.textBox1.Text = output;
This is almost there but it removes new line too, and leaves me with
1.2.3.4 sometext9.8.7.6 othertext5.6.7.8 moretext
I'm hoping there is a regex practitioner who might help me out.
Thank you for taking the time to read.
(edit) cannot post code or format text correctly for some reason.
My original string does not contain empty lines.