比如说:
我的一个richTextBox里面写着
hello everyone!
I am here .
我想把他的text读出来之后,放在两个string对象中,比如:
string s1= "hello everyone !"
string s2= "I am here ."
是不是要用到 richTextBox.Text.Find()来找的?
我要怎么写才能达到这种效果
string[] strings=richTextBox1.Text.Split(newstring[]{"\n"},StringSplitOptions.RemoveEmptyEntries); MessageBox.Show(strings[0]+"\n"+strings[1]);
string[] strings=richTextBox1.Text.Split(newstring[]{"\n"},
StringSplitOptions.RemoveEmptyEntries); MessageBox.Show(strings[0]+"\n"+strings[1]);
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer Help by clicking: Click here to donate your rice to the poor Click to Donate Click to feed Dogs & Cats
不记得了,是不是有一个readline方法?
或者你根据回车换行符号来分(字符串的 split方法)。
family as water