New Line character

  • Thread starter Thread starter Jeremy Bradshaw
  • Start date Start date
J

Jeremy Bradshaw

In c# how do I embed a new line / carriage return character into a string so
that when that string is put into a rich texbox it forces a new line ?
 
Jeremy,
In c# how do I embed a new line / carriage return character into a string so
that when that string is put into a rich texbox it forces a new line ?

"Line 1\r\nLine 2"

or

"Line 1" + Environment.NewLine + "Line 2"



Mattias
 
hi,
the simplest way to do a carriage return is put an "\n"
in the string, it's same as C string, but to be platform-independent, you
should write as folling
"Hello"+Environment.NewLine+"World!"

Regards,

Jonny Yu
 
Back
Top