From: Rick DeNatale Date: 2007-04-09T22:33:01+09:00 Subject: Re: Substring like in PHP's substr()? On 4/9/07, James Edward Gray II wrote: > > data = "/Users/Josh/Webwork/pgbookings" > prefix = "/Webwork/pgbookings" I think you meant prefix = "/Users/Josh" This doesn't affect the qualitative results of the benchmark but it does change it to do what the OP was trying to do. Note that "/Webwork/pgbookings" is NOT a prefix of "/Users/Josh/Webwork/pgbookings" And cosmetically there's a typo: > results.report("[i..-i]:") { TESTS.times { data > [prefix.length..-1] } } should be: results.report("[i..-1:") { TESTS.times { data[prefix.length..-1] } } -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/