我只需要每行剪切一个输入.然后在C#中切换每个单词空间的每一行但我似乎无法弄清楚2d数组是如何工作的

use*_*960 1 c# arrays

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)

Tim*_*ter 5

所以你想要数组的行和每行的一个单词数组:

string[][] lineWords = textBox1.Text
            .Split(new[] { Environment.NewLine }, StringSplitOptions.None)
            .Select(l => l.Split())
            .ToArray();
Run Code Online (Sandbox Code Playgroud)