Determines the index of a specific item in the collection.
The object to locate in the collection.
The index of item if found in the collection; otherwise, –1.
IndexOf won't throw an exception if the element specified as item doesn't exist in the collection. Instead, it will return -1, which is a special value that isn't valid as a true index.
If you have an index for an element that exists in the collection but not a reference, you can use the Item (indexer) property of HttpMediaTypeWithQualityHeaderValueCollection to get or set a value by index.
Minimum supported client
Minimum supported server
|Windows Server 2012 R2|
Minimum supported phone
|Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]|