Query string value by String.StartsWith : where : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » where »

 

Query string value by String.StartsWith








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

        string[] presidents = {"Ad", "Ar", "Bu", "B", "C", "C"};

        string president = presidents.Where(p => p.StartsWith("Ad")).First();

        Console.WriteLine(president);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» where