--927295978-786337774-11162442674570
Content-Type: MULTIPART/MIXED; BOUNDARY="927295978-786337774-1116244267=:24570"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--927295978-786337774-11162442674570
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

Hi --

On Mon, 16 May 2005, [ISO-8859-1] Brian Schröäer 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

(I had been toying with this but using break instead of return, which
was giving me problems :-)


David

-- 
David A. Black
dblack / wobblini.net
--927295978-786337774-11162442674570--
--927295978-786337774-11162442674570--