M
Michael Linfield
I want to convert certain letters to numbers on a gets.chomp..
my initial approach was this----
words = gets.chomp
new = words.each {|p| p.gsub(/[h]/, '00')}
puts new
#####
however this doesnt work the miracle
new = words.gsub(/[h]/, '00')
puts new
##### this works perfectly, but the problem occurs if i want to gsub
more than one character as if i have new = another.gsub then puts new
only outputs the last gsub.
Ideas?
Thanks!
my initial approach was this----
words = gets.chomp
new = words.each {|p| p.gsub(/[h]/, '00')}
puts new
#####
however this doesnt work the miracle
new = words.gsub(/[h]/, '00')
puts new
##### this works perfectly, but the problem occurs if i want to gsub
more than one character as if i have new = another.gsub then puts new
only outputs the last gsub.
Ideas?
Thanks!