Escape sequences problem

  • Thread starter Thread starter news.tin.it
  • Start date Start date
N

news.tin.it

Hi there,

I'm very new to C# programming, and I cant understand why, when inserting
the escape sequence "\n" in a string, (see code below), and the copying the
entire string on a textbox, each escape sequenze is shown as "]" and not as
a carriage return as should be.

Thanks in advance.

Code:
for(int n=1;n<10;n++)
mystring+= numb[n].tostring + "\n"

[END CODE]

Andrea
 
You need to use "\r\n" or Environment.NewLine if you want your code to be
more portable.

Also, is the textboxes MultiLine property set to true?
 
Back
Top