文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>c#数组类型转换

c#数组类型转换

时间:2010-08-26  来源:chqyang

 

代码  1 static void Main(string[] args)
 2 {
 3     string[] a = new string[] { "1", "2", "3" };
 4 
 5     //方法一
 6     int[] b = Array.ConvertAll(a, new Converter<string, int>(StrToInt));
 7 
 8     //方法二
 9     int[] c = Array.ConvertAll<string, int>(a, delegate(string n) { return int.Parse(n); });
10 }
11 public static int StrToInt(string str)
12 {
13     return int.Parse(str);
14 }

 

 

相关阅读 更多 +
排行榜 更多 +
儿童着色页面运输

儿童着色页面运输

休闲益智 下载
逃离宇宙穿越空间

逃离宇宙穿越空间

飞行射击 下载
行星火箭轰炸

行星火箭轰炸

飞行射击 下载