日期:2014-05-19  浏览次数:20807 次

Split和GetUpperBound 怎么用,有没有例子!
给个Split   和GetUpperBound   结合用的例子。

str= "123   456   789 "
想Label1.text=123
    Label2.text=456
    lable3.text=789   这样显示怎么做呢?
用不用GetUpperBound   函数?

------解决方案--------------------
string [] s = "123 456 789 ".Split( ' ');
label1.text = s[0];
label2.text = s[1];
lable3.text = s[2];

------解决方案--------------------
string arr=str.Split( " ");
Label1.text=arr(0);
Label2.text=arr(1);
Label3.text=arr(2);
------解决方案--------------------
寫錯了,是string[] arr=str.Split( ' ');
------解决方案--------------------
foreach (string s in "123 456 789 ".Split( ' '))
{
System.Console.WriteLine(s);
}