有没有好一点的方法把这样的字符串变成二给数组? 字符串格式如下:"a,b,c;你,我,他"分别以","和";"作分隔符得到string[,]或者string[][] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 例子:public static void Main(string[] args) { string s = "a,b,c;你,我,他"; string[] ss = s.Split(';'); string[][] sss = new string[ss.Length][]; for(int i = 0; i < ss.Length; i++) { sss[i] = ss[i].Split(','); } for(int i = 0; i < sss.Length; i++) { for(int j = 0; j < sss[i].Length; j++) { Console.WriteLine(sss[i][j]); } }} 看来还是得一个个赋值,thank you! 有一种办法 是VC写的不用这么写 C#我是不知道的 急。二进制转字符串 datagridview 导出excel 如何把字符,转化成ACSII码? 关于DataGridView的问题 SOCKET问题???出血1000分搞清楚它。 单机版exe,如何限制使用天数? GridView导出Excel的问题,总提示错误,网上的方法都试了,不行啊 polarlm(今年本命年),前一个问题的一些其他小问题,那个我结了。 过年关喽!今年你挣了多少? PDFBOX 打印PDF文件异常(未发送 StartDocPrinter 调用) 求简单正则写法!!!速度 在TreeView控件中进行排序后,有问题
string s = "a,b,c;你,我,他";
string[] ss = s.Split(';');
string[][] sss = new string[ss.Length][];
for(int i = 0; i < ss.Length; i++) {
sss[i] = ss[i].Split(',');
} for(int i = 0; i < sss.Length; i++) {
for(int j = 0; j < sss[i].Length; j++) {
Console.WriteLine(sss[i][j]);
}
}
}
不用这么写 C#我是不知道的