using System; using System.Collections.Generic; public class Example { static void Main() { int[] int_array = { 1, 2, 3 }; string[] str_array = Array.ConvertAll(int_array, new Converter<int, string>(IntToString)); foreach (string s in str_array) { Console.WriteLine(s); } Console.Read(); } public static string IntToString(int i) { return i.ToString(); } }
|