From: 12 34 Date: 2007-07-10T12:53:07+09:00 Subject: Re: Simple string operation Todd Benson wrote: > On 7/9/07, 12 34 wrote: >> seqNo = >> File.basename("/Volumes/MINOLTA1/DCIM/100MLT16/PICT0004.MOV",".*")[-1,3].to_s >> seqNo = "-" + seqNo+ ".xx.m" >> puts "seqNo: #{seqNo} " # >> seqNo: -4.xx.m >> >> but I want it to be -004.xx.m. In other words I want the leading zeros. > > Maybe you want [-3,3] instead of [-1,3]? > Maybe I do. Thank you -- Posted via http://www.ruby-forum.com/.