MvcValidatorToolkit/Extensions/NameValueCollectionExtensions.cs
/// <summary>
/// Indicates whether the collection contains the specified key.
/// </summary>
Indicates whether the collection contains the specified key.
Indicates whether the collection contains the specified key .
public static bool ContainsKey(this NameValueCollection collection, string keyToFind)
		{
			if(collection == null)
				throw new ArgumentNullException("collection");
			if(keyToFind == null)
				throw new ArgumentNullException("keyToFind");
			string k = keyToFind.ToLower().Trim();
			foreach(string key in collection)
			{
				if(key != null && key.ToLower().Trim().Equals(k))
					return true;
			}
			return false;
		}
public static bool ContainsKey ( this NameValueCollection collection , string keyToFind ) { if ( collection == null ) throw new ArgumentNullException ( " " ) ; if ( keyToFind == null ) throw new ArgumentNullException ( " " ) ; string k = keyToFind . ToLower ( ) . Trim ( ) ; foreach ( string key in collection ) { if ( key != null && key . ToLower ( ) . Trim ( ) . Equals ( k ) ) return true ; } return false ; }
Indicates whether the collection contains the specified key.
Indicates whether the collection contains the specified key .
NameValueCollection
this
keyToFind
string