.NET 2
string[] myStrings = GetMyStrings(); string test = \"testValue\";
How can I verify if myStrings contains test
myStrings
test
bool ContainsString(string[] arr, string testval) { if ( arr == null ) return false; for ( int i = arr.Length-1; i >= 0; i-- ) if ( arr[i] == testval ) return true; return false; }
And this will have the best performance ever. :P