In C #, we use the string "\ r \ n" to indicate a carriage return line break.
String str = "first line \ r \ n second line";
However, we recommend Environment.NewLine (the namespace is System), environment is a class, and NewLine is a string property that gets the carriage return newline character string defined in the current environment.
String str = "First line" + Environment.NewLine + "second row";
In a Windows environment, the C # language Environment.NewLine = = "\ r \ n" Results are true.
Small knowledge
| Name |
English |
Describe |
ASCII value |
C # represents |
| Carriage return character |
Carriage Return |
Back to the beginning of a line |
13 |
\ r |
| Line break |
New Line |
Next line start position |
10 |
\ n |
Carriage return a newline character is also sometimes referred to as a carriage return or newline character.
Carriage return line break in C #