The array class doesn't have the equivalent of ArrayList.Contains(). You'll
have to use a for loop or create an enumerator to iterate over the array
items until you find the desired object.
Alternatively, you could also create a temporary array list from the array
like so:
ArrayList _temp = new ArrayList(myArray)
if (_temp.Contains(someObject))
{
// do stuff
}
The latter solution requires less code, but it's much more expensive.
--
Kai Brinkmann [MSFT]
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
An ArrayList have a Contains method to check if a item in it:
myArrayList.Contains("Jhon");
if if myStringArray is a string array,
How can I check if a item in if