有一个整数数组,请声明一个字符串数组,将整数数组中的每一个元素的值转换为字符串保存到字符串数组中。

有一个整数数组,请声明一个字符串数组,将整数数组中的每一个元素的值转换为字符串保存到字符串数组中。

 int[] a = { 1, 2, 3, 4, 5, 6 };
            string[] b = new string[a.Length];
            for (int i = 0; i < a.Length; i++)
            {
                b[i] = Convert.ToString(a[i]);   
            }
            foreach (string item in b)
            {
                Console.Write(item + ",");
            }
                 Console.ReadKey();

原文地址:https://www.cnblogs.com/mvpbest/p/13227382.html