From: "Brian Schröder" Date: 2005-10-29T22:50:20+09:00 Subject: Re: chain regex replacement On 29/10/05, Brian Schr�der wrote: > On 29/10/05, onurturgay@gmail.com wrote: > > hi, > > I want to make a chain replacement in my String object. For example > > a => b > > c => d > > f => k > > > > etc. Is there a way to make this replacement in one regex or something > > similar? I want to write a custom upcase downcase method, as the normal > > one doesnt support unicode (and ruby-unicode doesnt compile on > > windows). > > > > Thanks in advance > > onur > > > > > > > > Did you look at tr > > "a big boy".tr("a-z", "A-Z") > => "A BIG BOY" > > regards, > > Brian > or even more like your example: > "hal".tr("za-y", "a-z") => "ibm" cheers, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/