zoukankan      html  css  js  c++  java
  • C# 实现 int[]到string[]的转换方法 Array.ConvertAll

    1. using System;   
    2. using System.Collections.Generic;   
    3.   
    4. //int[]到string[]的转换   
    5. public class Example   
    6. {   
    7.     static void Main()   
    8.     {   
    9.         int[] int_array = { 1, 2, 3 };   
    10.   
    11.         string[] str_array = Array.ConvertAll(int_array, new Converter<intstring>(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. }  

  • 相关阅读:
    UVA 558 Wormholes
    HDU 1565 方格取数(1)
    poj2607
    poj2552
    poj2491
    poj2502
    poj2613
    .NET Framework 4 与 .NET Framework 4 Client Profile的区别与联系
    .Net Framework 4.0 和 2.0/3.0/3.5
    企业IT系统
  • 原文地址:https://www.cnblogs.com/liufei88866/p/1762653.html
Copyright © 2011-2022 走看看