I have a list of words like so :
List<string> list = new List<string>();
list.Add("Horse");
list.Add("Shorse"):
I want to search the list for a specific string, regardless of case, but it has to be an EXACT match, if i do
if (list.Contains("horse",StringComparer.CurrentCultureIgnoreCase))
{
//do something
}
It will find both Horse and Shorse.
How can i implement my own custom Contains method that will find an exact match?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…