using
System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LinQ001
... {
class Program
...{
static void Main(string[] args)
...{
List<string> names = new List<string> ...{ "jason", "simon", "tom", "white", "smith", "lus" };
IEnumerable<string> nameQuery =
from name in names
where name.IndexOf('n')>=0
select name;
foreach (string name in nameQuery)
...{
Console.WriteLine(name);
}
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LinQ001
... {
class Program
...{
static void Main(string[] args)
...{
List<string> names = new List<string> ...{ "jason", "simon", "tom", "white", "smith", "lus" };
IEnumerable<string> nameQuery =
from name in names
where name.IndexOf('n')>=0
select name;
foreach (string name in nameQuery)
...{
Console.WriteLine(name);
}
Console.ReadLine();
}
}
}