I want to implement incremental search on a list of strings. Consider I have an array containing which contains the strings store,state,stamp,crawl,crow. My application has a te
Instead of an array of strings you could use a generic collection. This way you can use the FindAll method with a delegate to search through the items.
string searchString = "s";
List<string> sl = new List<string>();
sl.Add("store");
sl.Add("state");
sl.Add("stamp");
sl.Add("crawl");
sl.Add("crow");
List<string> searchResults = sl.FindAll(delegate(string match)
{
return match.StartsWith(searchString, StringComparison.CurrentCultureIgnoreCase);
});