Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Ruby
ruby find index of element in array
Ant P
Programming language:
Ruby
2021-04-01 01:30:26
0
Q:
ruby find index of element in array
hatano yui
Code:
Ruby
2021-08-04 13:15:01
a = [ "a", "b", "c" ] a.index("b") #=> 1 a.index("z") #=> nil
2
Tags
array
element
find
index
Related
ruby each with index
ruby find biggest int in array
ruby find in array
New to Communities?
Join the community