Recently, during my internship at the company, I encountered the character string Line Break Problem. Baidu found many character string line breaks and summarized the most basic points to avoid forgetting them.
\ N-> Line Break (New Line), which is used to display the string following the line break to the position starting with the next line"
Console. Write ("Features: [WeChat official website] accesses founder zhengzhong anytime and anywhere to obtain the latest futures information. \ N [micro-account opening] download the Founder's small-party account opening client to facilitate mobile account opening. \ N [menu] 1. Futures Information 2. Stock Information 3. Feedback");
Shown as follows:
The strings after \ n are displayed in a new line.
\ R-> carriage return (carriage return) is used to return \ r to the beginning of a line (the first line is returned), and the string before \ r is no longer displayed, as shown below.
Console. Write ("Features: [WeChat official website] accesses founder zhengzhong anytime and anywhere to obtain the latest futures information. \ N [micro-account opening] download the Founder's small-party account opening client to facilitate mobile account opening. \ R [menu] 1. Futures Information 2. Stock Information 3. Feedback");
Generally, \ r \ n is used to represent the carriage return line break, string STR = "the first line \ r \ n the second line ";
You can also use environment. newline (The namespace is system), environment is a class, and newline is a string attribute to obtain the carriage return linefeed string defined in the current environment.
String STR = "first line" + environment. newline + "second line ";
In Windows, the C # language environment. newline = "\ r \ n" returns true.