using System.Collections.Generic;
public static void Main()
string text = @"LINQ extends the language by the addition of query expressions, " +
@" which are akin to SQL statements, and can be used to conveniently extract and " +
@" process data from arrays, enumerable classes, XML documents, relational databases, " +
@" and third-party data sources.";
string searchTerm = "to";
string[] source = text.Split(new char[] { '.', '?', '!', ' ', ';', ':', ',' }, StringSplitOptions.RemoveEmptyEntries);
var matchQuery = from word in source
where word.ToLowerInvariant() == searchTerm.ToLowerInvariant()
int wordCount = matchQuery.Count();
Console.WriteLine("Tim thay tu khoa \"{0}\" xuat hien {1} trong doan van ban.", searchTerm, wordCount);
Console.WriteLine("Nhan bat ky phim nao de thoat chuong trinh.");