Linq can be used to help in comparing the strings.
String[] ListOfWords = {"Duis","urna","enim","rhoncus","sit","amet","dignissim","ut","sollicitudin","at"};
String WholeText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris lacinia ex euismod lectus convallis lobortis. Integer vitae faucibus lectus, et molestie enim. Fusce condimentum sapien et felis iaculis volutpat. Nam vel mauris id velit consectetur pulvinar at et tellus. Fusce id lacus pretium, vehicula enim a, condimentum urna. Nam id erat est. Ut eu risus ultricies, dapibus leo quis, sollicitudin velit. Phasellus quis nulla ligula. Nam rhoncus leo vitae magna aliquet vulputate. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum faucibus ante nisi, a iaculis ipsum consectetur quis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut sit amet lobortis eros. Nullam at lectus sit amet nibh congue tempor. Donec lobortis dapibus neque, at dapibus tortor vulputate sit amet.";
var FindWord = (from word in ListOfWords
where WholeText.Split(' ').Contains(word)
select word
);
var FindWord = WholeText.Split(' ').Intersect(ListOfWords);
foreach (var s in FindWord){
Console.WriteLine(s);
}
Enumerable.Intersect<tsource> Method:
http://msdn.microsoft.com/en-us/library/vstudio/bb460136(v=vs.100).aspx[
^]