根据字符串截取生成数组 本帖最后由 guanzg 于 2014-03-25 17:23:24 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用两次Split应该可以实现的吧string str = "空,空,空;空,蔡厝621,空;空,空,空;"string[] temp = str.Split(';');string[][] list = new string[temp.Length][];for(int i=0; i < temp.Length; i++){ list[i] = temp[i].Split(',');} 一句话搞定: void Main(){ string str = "空,空,空;空,蔡厝621,空;空,空,空;" var temp=Regex.Split(str,@"(?<=\G(?:\w+[,,]){3})"); temp.ToList().ForEach(t=>Console.WriteLine(t));}http://blog.csdn.net/q107770540/article/details/6436973 update:var temp=Regex.Split(str,@"(?<=\G(?:\w+[,;]){3})"); C#中将JSON数据解析为XML的方法,给个例子,谢谢 求高人指点,djvu写入程序 麻烦各位大侠帮我看看这段语句有什么问题? 请问这是为什么啊? DataGridView中的combobox,1,0与男,女的问题? WPF+wcf 没有终结点在侦听可以接受消息的 特急:c#中一个令我困惑的输出结果重定向问题,望高手指点 谁能教教我怎么打包啊 求救!!!多谢!!! 请教string.format的问题 C#类的方法互相调用问题,非静态方法要怎么实现? .Net 前后台交互问题
string str = "空,空,空;空,蔡厝621,空;空,空,空;"
string[] temp = str.Split(';');
string[][] list = new string[temp.Length][];
for(int i=0; i < temp.Length; i++){
list[i] = temp[i].Split(',');
}
void Main()
{
string str = "空,空,空;空,蔡厝621,空;空,空,空;"
var temp=Regex.Split(str,@"(?<=\G(?:\w+[,,]){3})");
temp.ToList().ForEach(t=>Console.WriteLine(t));}
http://blog.csdn.net/q107770540/article/details/6436973
var temp=Regex.Split(str,@"(?<=\G(?:\w+[,;]){3})");