字符串转数组 用C#来实现string Str="11,12,13";怎么能转成数组啊 要求类型为string数组和int 数组大虾们应该没困难吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string Str="11,12,13"; string[] ckb = null; ckb = Str.Split(new char[] { ',' }); string s="11,12,13"; string[] Str_s= s.Split(new char[] { ',' });int[] Int_s=new int[Str_s.Length];for(int i=0;i<Str_s.Length;i++)Int_s[i]=Convert.ToInt32(Str_s[i]); string []strs = str.Split(new char[]{','}); int []intstrs = new int[strs.Length]; int i = 0; foreach (string s in strs) { intstrs[i] = int.Parse(s); i++; } string []strs = str.Split(','); 1楼标准答案,支持不过ckb = Str.Split(new char[] { ',' });可以改成ckb = Str.Split( ',' );吧 string Str="11,12,13"; int[] output = Array.ConvertAll<string, int>(Str, delegate(string s) { return int.Parse(s);}); C#读取txt文件中的数据内容 这段xml怎么读取 急!求删除已上传图片代码!在线等! excel读取工作部名称? 调用函数中的方法 在.net 2.0 如何调用WebService的构造函数中带参数的 VS.2005应用程序打包问题!求解! C# 网络编程问题 C#的两个form交替的问题,请进. c#中datagridview 高分求C#采集文章源码 获取下拉列表的值
string Str="11,12,13";
string[] ckb = null; ckb = Str.Split(new char[] { ',' });
string[] Str_s= s.Split(new char[] { ',' });
int[] Int_s=new int[Str_s.Length];
for(int i=0;i<Str_s.Length;i++)
Int_s[i]=Convert.ToInt32(Str_s[i]);
int []intstrs = new int[strs.Length];
int i = 0;
foreach (string s in strs)
{
intstrs[i] = int.Parse(s);
i++;
}
1楼标准答案,支持
不过ckb = Str.Split(new char[] { ',' });可以改成ckb = Str.Split( ',' );吧
int[] output = Array.ConvertAll<string, int>(Str, delegate(string s) { return int.Parse(s);});