From: "yermej@..." Date: 2007-09-28T03:55:03+09:00 Subject: Re: gsub-ing each character Sorry, more mistakes. I'm giving up after this. subs = { 'h' => '00', 'i' => '01', 'j' => '02', } words = gets.chomp new = subs.inject(words) {|acc, sub| acc.gsub(sub[0], sub[1])} unless words.nil? or: words = gets.chomp new = words.gsub('h', '00').gsub('i', '01').gsub('j', '02') unless words.nil? Hopefully that's right. Jeremy