From: Bill Kelly Date: 2005-05-17T01:55:28+09:00 Subject: Re: determining common characters from start of two strings? From: "Robert Klemme" > > Regexps can help here - dunno about performance > > class String > def lcommon(s) > len = s.length > Regexp.new("^" << s.gsub( /./, '(?:\\&' ) << ( ")?" * > len ) ).match(self)[0] > end > end Heheheheheheheh.... Nice. ;) Regards, Bill