不用循环,对数组每个元素进行处理,类型转换和输出
1 double[] s0 = { 1, 2, 3 }; 2 3 //string[] s1= s.Cast<string>().ToArray();//必须为子类型,不存在类型转换 4 string[] s1 = Array.ConvertAll(s0, delegate(double o) { return o.ToString(); }); 5 string[] s2 = Array.ConvertAll(s0, o => o.ToString()); 6 string s3 = string.Concat(s0); 7 string s4 = string.Join(",", s0); 8 double[] s5 = Array.ConvertAll(s0, o => o / s0.Sum());