I have this string, it looks like this
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 = "188.8.131.52 sometext \r\n184.108.40.206 othertext\r\n220.127.116.11 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
18.104.22.168 sometext22.214.171.124 othertext126.96.36.199 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.