From: Lee Jarvis Date: 2007-09-11T20:51:27+09:00 Subject: Re: Substitution with Hash Thanks that worked well, And no its not single chars, Which is the only reason i'm doing it this way.. I have to split on whitespace (/ /) because spliting on characters would obviously split the text i want to transform, which means it wont match if the characters are trailing another word, HTML special chars for example h = {"~" => "~"} "hmm ~'.split(/ /).map{|c| h[c] || c}.join(' ') Outputs hmm ~, but obviously doing things like question marks wont work, Maybe i'll have to use loops and string#tr -- Posted via http://www.ruby-forum.com/.