string agentInfo = userInfo.Attribute19.ToString();
string[] myAgent = agent1.$1(new string[] myAgent = agentD.R.H含 if (myAgent.Length == 3)
{
this.QCalenderStartDate.Value = myAgent[1].ToString();
this.QCalenderEndDate.Value = myAgent[2].ToString();
##N
string str="aaajsbbbjsccc";
foreach (string i in sArray) Response.Write(i.ToString() + "
");
輸出結果:
aaa
bbbccc
2、用多個字元來分隔:
string str="aaajbbbscccjdddseee ";
string[] sArray=str.Split(new char[2]{'j','s'});
foreach(string i in sArray) Response.Write( i.ToString() + "
");
aaa
bbbccc
dddeee
3、用單一字元來分隔:
##string str="aaajbbbjccc";
string[] sArray=str.Split('j');
輸出結果:aaa
bbbccc
以上是字串分割的使用實例程式碼的詳細內容。更多資訊請關注PHP中文網其他相關文章!