Converting Between Symbols and Strings


#1

Sorry guys...why this isn't working?

strings = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]
symbols = []

strings.each {|s|}
symbols.push(s.to_sym)
end

`


#2

you can't have {} and the end at the same time.
strings.each do |s|
symbols.push(s.to_sym)
end

or

strings.each { |s| symbols.push(s.to_sym)}

both work


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.