I went to http://ruby-doc.org/core/classes/Array.html#M002198 and can't figure out the way to take an array of names for example
people = [chris,george,jerry,bob,bill,julie,josh]
I want to be able to have the user select a letter "b" then hit enter and extract all elements with the first letter 'b' and put them in a seperate array. In this case it would be [bob,bill] The .slice command should work for this but I don't know how to tell it to just look at the first letter of the elements? Would that be some sort of a argument that would need to be filled like this people.slice()
people_selector = gets.chomp.to_s
people.slice(people_selector)
print people
Google is no help either, unfortunately. Post code so I can look at argument values please. Thanks,
Matt