Possible Duplicate:
how to check if my array includes an object - rails
我有一个数组
array['one', 'two', 'three']
如何在数组中找到"2"元素.
ruby中有什么方法可以找到这个吗?
谢谢
Possible Duplicate:
how to check if my array includes an object - rails
我有一个数组
array['one', 'two', 'three']
如何在数组中找到"2"元素.
ruby中有什么方法可以找到这个吗?
谢谢
array.include?('two')
返回true
或false