From: Li Chen Date: 2009-07-23T00:28:48+09:00 Subject: Re: create a variable number of loop steve wrote: > Li Chen wrote: >> >> 'A'=>0; 'B'=>1;''C'=>2; ''D'=>3; >> >> >> Li > > C:\Documents and Settings\Administrator>irb > irb(main):001:0> "DDDD".tr("DCBA","3210").to_i(4) > => 255 > irb(main):002:0> Steve, Thank you so much. It is so neat! Li -- Posted via http://www.ruby-forum.com/.