April 2002
Intermediate to advanced
688 pages
19h 51m
English
Queue.Contains Method
System.Collections.Queue
queuevariable.Contains(obj)
obj (required; any)The value to search for on the queue
Boolean (True or False)
indicating whether obj is found in the
queue
Returns a Boolean indicating whether a given element whose value is
obj is somewhere in the queue
obj must correspond exactly to an item in
the queue for the method to return True.
The method searches the queue sequentially. In other words, its performance is inversely proportional to the number of items in the queue.
In comparing objects in the queue with
obj, the Contains method in turn calls the
BCL’s Object.Equals method to perform the
comparison. The Equals method returns True if two
object instances are the same instance.