DR00ME Posted February 15, 2004 Posted February 15, 2004 Is there a similar function for VB.NET as in PHP : array_key_exists -- Checks if the given key or index exists in the array. return true or false. <?php $search_array = array("first" => 1, "second" => 4); if (array_key_exists("first", $search_array)) { echo "The 'first' element is in the array"; } ?> if there isnt could you please write me one :D Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
Heiko Posted February 15, 2004 Posted February 15, 2004 Use the ArrayList Object. It has a .contains method. (I think) Quote .nerd
DR00ME Posted February 15, 2004 Author Posted February 15, 2004 is it like if array.indexOf is empty then it didnt find the requested e.g. number or string... and its false.. ? Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
DR00ME Posted February 15, 2004 Author Posted February 15, 2004 (edited) Use the ArrayList Object. It has a .contains method. (I think) how do I make a normal array to ArrayList object and search inside it for a specific integer huh ? Edited February 15, 2004 by DR00ME Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
DR00ME Posted February 15, 2004 Author Posted February 15, 2004 (edited) B(50) as byte lblPixelClr.Text = CStr(Array.IndexOf(B, 240)) the problem is that B is not an Array... well it is ..but its type is not array... so that thing is not working... so is there way to convert byte array to array ? huh... or what is the difference between: B(50) as Byte B(50) as Array But both are arrays right ? im confused... someone lighten me please! Edited February 15, 2004 by DR00ME Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.