From: Bill Kelly Date: 2005-05-16T17:17:31+09:00 Subject: determining common characters from start of two strings? Hi, Is there any ruby built-in that might tell me how many characters match (are in common) from the start (left) of two strings? E.g. "abcxxxxxx".lcommon("abcdezzzzz") # => "abc" (or 3) All I need is the length but a substring would be fine too. Figured I'd ask in case I'd overlooked a nicer way to do this than writing a loop. :) Thanks, Regards, Bill