C# textbox problem, how to cut the value of the textbox
Hi i am writing an app in c# using windows form, In this form i have a text box that get input form a user, And then I need to to some changes on it. The problem is that the value in the text box is a long string with "\r\n" as a separator between lines. How can I get the text in the text box, I need that every 开发者_如何学Cline will be a cell a so I can get a string[].
thanks
You could do:
string temp = textBox1.Text;
string[] strList = temp.Split("\\r\\n");
You could use the .Lines
property of TextBox control, that already contains the text splitted in lines.
Try using method Split("\r\n") on the string returned from Textbox.Text
精彩评论