C# Textbox string separation

后端 未结 8 1701
遇见更好的自我
遇见更好的自我 2021-01-22 08:43

I have textbox in c#, contains two or three strings with white spaces. i want to store those strings seperately.please, suggest me any code. thanx.

8条回答
  •  情书的邮戳
    2021-01-22 09:09

    Try :

        string data = TextBox1.Text;
        var s1 = data.Split();
    
        string a = s1[0].ToString();
        string  b= s1[1].ToString();
    

提交回复
热议问题