您的位置:首页 > 其它

[.net]通过固定字符拆分字符串并填入数组里

2008-05-23 17:32 357 查看
public static System.Collections.ArrayList Recfstring(string mystring, char mychar)

//通过固定字符 拆分字符串 并填入数组里

{

System.Collections.ArrayList myAL = new System.Collections.ArrayList();

int i = 0;

string temStr = "";

foreach(char character in mystring)

{

if(character==mychar)

{

myAL.Add(temStr);

temStr = "";

}

else

{

temStr = temStr + character;

}

i = i + 1;

}

return myAL;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐