From: Sebastian Hungerecker Date: 2009-01-18T18:52:20+09:00 Subject: Re: string.tr bug? borasque@borasque.com wrote: > I found strange behaviour of string.tr: > > p "=+=/=".tr("+/=", ",-@") > got ".,.-." > expected "@,@-@" > > Is this bug in ruby? It's not a bug. For tr ",-@" is the same as ",-./0123456789:;<=>?@". You have to escape the - to use it as a literal "-": "=+=/=".tr("+/=", ',\-@') #=> "@,@-@" HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826