If your target array is only going to contain single-character strings, then no. But if the strings get larger, you risk matching "food" when you're seeking "foo". And if the strings ever contain spaces, you risk more false positives.
Better, I think, to use grep.
In reply to Re: Is X in my array?
by dws
in thread Is X in my array?
by Not_a_Number
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |