I have a
List
with 1500 strings. I am now using the following code to pull out only string that start with the string prefix
You can accelerate a bit by comparing the first character before invoking StartsWith:
char first = prefixText[0]; foreach(string a in ) { if (a[0]==first) { if(a.StartsWith(prefixText, true, null)) { newlist.Add(a); } } }