C# 字符串切割——Split


string str="1,2,3,4,5"; string[] sArray=Regex.Split(str,",",RegexOptions.IgnoreCase);


多字符串
string str="aaajbbbscccjdddseee";
string[] sArray=str.Split(new char[2]{'j','s'}); //分割结果为aaa bbb ccc ddd eee
单字符串
string str="aaajbbbjccc";
string[] sArray=str.Split('j'); //分割结果为 aaa bbb ccc


转载:https://www.cnblogs.com/luyj00436/p/11658687.html
posted @ 2020-01-17 11:41  绯颜旧雨  阅读(470)  评论(0编辑  收藏  举报