string[][] Chop = null;
string[] Line = null;
private void button1_Click(object sender, EventArgs e)
{
Line = textBox1.Text.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None); // Im succesfull at cutting the input per line and stores it per line in Line variable.
for(int x = 0;x < Line.Length; x++)
Chop[][x] = Line[x].Split(' ');
//I want the Chop to have an array of array of strings.
Run Code Online (Sandbox Code Playgroud)
所以你想要数组的行和每行的一个单词数组:
string[][] lineWords = textBox1.Text
.Split(new[] { Environment.NewLine }, StringSplitOptions.None)
.Select(l => l.Split())
.ToArray();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
89 次 |
| 最近记录: |