时间:2021-07-01 10:21:17 帮助过:42人阅读
输出下面的结果:
string s="abcdeabcdeabcde";
string[] sArray=s.Split('c');
foreach(string i in sArray)
Console.WriteLine(i.ToString());
输出下面的结果:
string s="abcdeabcdeabcde"
string[] sArray1=s.Split(new char[3]{'c','d','e'});
foreach(string i in sArray1)
Console.WriteLine(i.ToString());
输出下面的结果:
string content="agcsmallmacsmallgggsmallytx";
string[]resultString=Regex.Split(content,"small",RegexOptions.IgnoreCase)
foreach(string i in resultString)
Console.WriteLine(i.ToString());