string.split方法,如何用整个子字符串进行分割,而不是单个字符? 比如: "good,.bad" 用",."整个字符串作为分割,只产生 good和bad两个字符串 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str="123,.456,.789";string[] arr = str.Split(new char[]{',.'});Label1.Text=arr[0].ToString(); int i;string temp;string[] newstr;temp="good,.bad";temp=temp.Replace(",.",",");newstr=temp.Split(',');for (i=0;i<newstr.Length;i++){ Console.WriteLine(newstr[i]);}Console.ReadLine(); new Regex( ",\\." ).Split string strLink="head|||will";arrLink = strLink.Split("|||".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); C#连接到WMI 在.Net开发中,如何查询相应配置属性的枚举类型有几种选项 如何使用sqlhelper;跪谢 哈哈,发现一个.Net Framework 3.5 的BUG 意外字符$ 修改代码 c#生成程序问题! .net 前台调用后台传递参数问题 C# sock最大连接数 简单问题 江湖救急-----SOS!!!!!!!!!!!! txtBox的Tag属性怎么用???
string[] arr = str.Split(new char[]{',.'});
Label1.Text=arr[0].ToString();
string temp;
string[] newstr;
temp="good,.bad";temp=temp.Replace(",.",",");
newstr=temp.Split(',');for (i=0;i<newstr.Length;i++)
{
Console.WriteLine(newstr[i]);
}
Console.ReadLine();
arrLink = strLink.Split("|||".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);