01.using System;   
02.using System.Collections.Generic;   
03.  
04.//int[]到string[]的转换   
05.public class Example   
06.{   
07.    static void Main()   
08.    {   
09.        int[] int_array = { 1, 2, 3 };   
10.  
11.        string[] str_array = Array.ConvertAll(int_array, new Converter<int, string>(IntToString));   
12.  
13.        foreach (string s in str_array)   
14.        {   
15.            Console.WriteLine(s);   
16.        }   
17.        Console.Read();   
18.    }   
19.  
20.    public static string IntToString(int i)   
21.    {   
22.        return i.ToString();   
23.    }   
24.}  

 

相关文章:

  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-11-06
  • 2021-09-13
  • 2021-10-24
  • 2021-07-21
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2021-10-02
  • 2021-06-19
  • 2022-01-18
  • 2021-08-06
相关资源
相似解决方案