One of the very helpful method in array is include?
if you want to know what is your array contained? you can try to doing this:
| @my_array = ['ruby', 'on', 'rails']
@my_array.include?(“rails”) # This will return “true” |
June 3, 2008 by whenurnotaround
One of the very helpful method in array is include?
if you want to know what is your array contained? you can try to doing this:
| @my_array = ['ruby', 'on', 'rails']
@my_array.include?(“rails”) # This will return “true” |