PDA

Click to See Complete Forum and Search --> : [RESOLVED] [1.0/1.1] finding value from array


popskie
Jul 27th, 2006, 01:56 AM
Hi ,
How to find value inside the array with out using a loop?

thanks,
Popskie

ComputerJy
Jul 27th, 2006, 04:57 AM
Would you please explain more?

If you want to find a value inside an array you can use Array[Index];

penagate
Jul 27th, 2006, 05:21 AM
Are you looking for Array.IndexOf() ?

popskie
Jul 27th, 2006, 05:30 AM
Sorry
Ex.
String[] test = {"A","B","C","M","Z"}

this the scenario, if i pass A or B or C or Z
it return true or 1
but if i pass Q it return false or 0
if i pass W it return false or 0
if i pass X it return false or 0

I hope I make my self clear at this time.


Thank,

penagate
Jul 27th, 2006, 05:34 AM
Array.IndexOf(test, "A") >= 0

popskie
Jul 27th, 2006, 05:38 AM
Thanks penagate. LOL hehe. Wow