Ruby program to get keys from a hash collection
students = {"101" => "Amit", "102" => "Arun", "103" => "Sumit"};
puts "Student ids: ",students.keys();
Output:
Student ids:
101
102
103
students = {"101" => "Amit", "102" => "Arun", "103" => "Sumit"};
puts "Student ids: ",students.keys();
Output:
Student ids:
101
102
103