VVS*_*VVS 11
使用TextBox.Lines属性,它是一个表示文本行的string []数组:
textBox.Lines.Count > 0 ? textBox.Lines[0] : null
Run Code Online (Sandbox Code Playgroud)
或者(和更短):
textBox.Lines.FirstOrDefault()
Run Code Online (Sandbox Code Playgroud)
myTextBox.Text.Split(Environment.NewLine).FirstOrDefault();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7644 次 |
| 最近记录: |