How to insert newline in string literal?

前端 未结 12 801
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 09:07

In .NET I can provide both \\r or \\n string literals, but there is a way to insert something like \"new line\" special character like Enviro

12条回答
  •  广开言路
    2020-12-07 10:04

    If I understand the question: Couple "\r\n" to get that new line below in a textbox. My example worked -

       string s1 = comboBox1.Text;     // s1 is the variable assigned to box 1, etc.
       string s2 = comboBox2.Text;
    
       string both = s1 + "\r\n" + s2;
       textBox1.Text = both;
    

    A typical answer could be s1 s2 in the text box using defined type style.

提交回复
热议问题