Converting an Array of Strings to Integers : select : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » select »

 

Converting an Array of Strings to Integers








    
 

using System;
using System.Linq;
public class MainClass {
    public static void Main() {

        string[] numbers = { "0042", "010", "9", "2q7" };

        int[] nums = numbers.Select(s => Int32.Parse(s)).ToArray();

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» select