I have a ListBox and a list of all the English names.
OK, let's say that a "user" input letter "J". I want my ListBox to pick a few items (maybe 5) to display the results to the user.
I don't want when my user types "J" and the ListBox have to load every name starting with "J". All I want my ListBox to do is randomly load a few items results starting with letter J.
List<string> DictionaryList = new List<string>().Take(5).ToList();
//WEB
WebClient web = new WebClient();
String html = web.DownloadString("http://www.EXAMPLE.org/Letter/J");
MatchCollection m1 = Regex.Matches(html, @"<li>\s*(.+?)\s*</li>", RegexOptions.Singleline);
foreach (Match m in m1)
{
string city = m.Groups[1].Value;
DictionaryList.Add(city);
}
ANOTHER QUESTION UPDATE:
How can I update my ListBox result when user add another letter, example("Ja"). When user input "Ja". I want to update my ListBox to do the same thing as the question above(randomly pick few result close to "Ja")
Thanks, Wan-Fai.