From: Bill Kelly Date: 2005-05-17T02:15:50+09:00 Subject: Re: determining common characters from start of two strings? From: "David A. Black" > > On Mon, 16 May 2005, [ISO-8859-1] Brian Schr�der wrote: > > > class String > > def lcommon(other) > > 0.upto(length) do | i | return i if other[i] != self[i] end > > length > > end > > end > > You can also use the return value of times to do this: > > class String > def lcommon(other) > length.times do |i| return i if other[i] != self[i] end > end > end Cool solutions, guys - thanks ! Regards, Bill