Finished, but help required not related to the tasks!



So i've done the tasks, but now trying to clean things up, including making user input's convert to downcase, so they can write in capital and the case statments will still work and sorting the display of all the films in alphabetical order (see below).
Anyway, I want to know how to get the films being displayed, come out displayed without _ and instead with actual spaces, as in: The Breakfast Club instead of The_Breakfast_Club


movies = {
    DK: 10,
    Harry_Potter: 10,
    Departed: 8,
    The_Breakfast_Club: 7,

    when "display"
        movies.sort.each {|title, rating| puts "#{title}: #{rating}"}


Compiled from the found articles with google search
ruby replace underscore
ruby sorting a hash by key ascending{|k,v|
     puts "#{k.downcase.split('_').join(' ')} #{v}"


Thanks for the response, I tried the way you wrote it and the way the people in the first link was saying, but just keep getting errors.


could you give us the EXACT error you are getting......
to start, remove the comma-,
in your movies-dictionary from the line
The_Breakfast_Club: 7


The movies in your hash are currently symbols.

Try changing it to strings right before you puts and then using the .include? and .gsub! method. :slight_smile: