Ruby geting index of a part of an array element : My question is how can I get the index of a part of an array element? For example I have an array like:

array = [ username=stackoverflow, password=12345, id= 6]

My wish is searching like " id " in that array, and the code returns me index of the " id=6" element( returns me 3).
Is that possible in ruby?