No, that'd replace string literals, rather than escape sequences, and the
OP's code was fine.
I'd prefer the following though:
textBox1.Text=textBox1.Text.Replace(System.Environ ment.NewLine +
System.Environment.NewLine, System.Environment.NewLine);
Not as succinct, but more portable.
"EastDawnRitual" <Ea************@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Try this
textBox1.Text=textBox1.Text.Replace(@"\r\n\r\n",@" \r\n");
"Keith Smith" wrote:
How come this code doesn't seem to work?
textBox1.Text=textBox1.Text.Replace("\r\n\r\n","\r \n");
I want to remove all blank lines in a textBox.