Lee Jarvis wrote the following on 11.09.2007 12:41 : > Ok i'll try to explain what i mean as well as i can > > Lets say i have a hash like this > > hash { 'a' => '1' } #just as example, its actually far bigger > > and if a user inputs abcdabcd i was it to sub all of the a's with 1's.. > > As i said, the hash is far larger which is why i can't just do it with > gsub.. > > Any ideas? > > Thanks in advance.. > > Lee > yourstring.split(//).map{|c| hash[c] || c}.join