Here is the simple code
namespace My_Samples
{
using System;
using System.Linq;
class Program
{
static void Main(string[] args)
{
string[] inputs = new string[5] { "Ape", "Ant", "Dog", "Cat", "Elephant" };
var result = from i in inputs
where i[0].Equals('A')
select i;
foreach (string s in result)
{
Console.WriteLine(s);
}
Console.ReadLine();
}
}
}
No comments:
Post a Comment