From: Tomaso Tosolini Date: 2007-12-29T22:19:58+09:00 Subject: Re: trimming leading zeros Dipesh Batheja wrote: > Is there any function in ruby which allows you to trim leading zeros (or > any specific character) from a string. Or if there is some reg > expression that i can use? Hi if you have string expressions like s = 0{1,*}[1-9]* (some number with leading zeros) perhaps the must obvious method is s.to_i.to_s :) but this isn't genralizable to other kind of leading characters, for them a regexp may be better Tom