Home > Code > LINQ > Get values from collection using LINQ

Get values from collection using LINQ

by Shiva murugan   on May 05, 2011   Category: LINQ   |  Views: 1132    |  Points: 25   |  Bronze 


Here i will show you how to get values from array of string using linq.

string[] Name = { "john", "Varun", "kishor", "Sakthi" };
IEnumerable GetResult = (from name in Name
where name.Equals("Varun")
select name );

foreach (string output in GetResult)
{
Response.Write(output);
}




Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts