How to check if *number* is in a array
Posted
by Emil
on Stack Overflow
See other posts from Stack Overflow
or by Emil
Published on 2010-04-20T17:27:17Z
Indexed on
2010/04/20
17:33 UTC
Read the original article
Hit count: 201
Pretty basic programming question, I know PHP have a function for it, but does the iPhone OS have one?
I want to check if the current indexPath is a value in an array.
PHP Example:
<?php
$indexPath = 3;
$array = array("0", "1", "2", "3", "4");
if (in_array($indexPath, $array)) {
// Do something
}
?>
Does anybody know how to do the same thing inthe iPhone OS?
© Stack Overflow or respective owner