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 = "220.127.116.11 sometext \r\n18.104.22.168 othertext\r\n22.214.171.124 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
126.96.36.199 sometext188.8.131.52 othertext184.108.40.206 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.