C# Textbox string separation

后端 未结 8 1536
遇见更好的自我
遇见更好的自我 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:05

    Firstly use this name space

    using System.Text.RegularExpressions;
    

    in your code

     string Message = "hi i am fine";
     string []Record=Regex.Split(Message.Trim(), " ");
    

    Output is an array. I hope it works.

提交回复
热议问题