Introduction
Hi I know there are many way to find string form list of string using linq, but here i demonstrates one way to find string using linq, don't know whether the example is standard or not, see the code below
Code
List<string> strings = new List<string>();
strings.Add("A,1,Kailash");
strings.Add("B,2,Vinay");
strings.Add("C,3,Bhushan");
strings.Add("A,4,Prasant");
string[] strings1 = strings.Where(c => c.StartsWith("A")).ToArray<string>();
foreach (string st in strings1)
Console.WriteLine(st);
|