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 = "18.104.22.168 sometext \r\n22.214.171.124 othertext\r\n126.96.36.199 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
188.8.131.52 sometext184.108.40.206 othertext220.127.116.11 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.
Edited by pritaeas: Added markdown.