Thanks, I was looking for a function like that but it's not mentioned at http://www.ruby-doc.org/core-2.1.0/Array.html.