Stack.Contains Method


Stack.Contains Method

Class

System.Collections.Stack (standard version)

System.Collections.Generic.Stack (generic version)

Syntax

     Dim result As Boolean = stackVariable.Contains(obj) 


obj (required; any)

The object to search for on the stack

Description

The Contains method indicates whether a given object is somewhere on the stack (true) or not (False).

Usage at a Glance

  • obj must correspond exactly to an item on the stack for the method to return TRue.

  • String comparison is case-sensitive and is not affected by the setting of the OptionCompare statement.

Version Differences

Visual Basic 2005 adds support for generics to stacks, as discussed in Chapter 10.

See Also

Stack Class




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net