# Ruby, 44 characters <!-- language: lang-ruby --> ->a,b{i=0;i+=1while a[i]&&a[i]==b[i];a[0,i]} Sample run: 2.1.5 :001 > ->a,b{i=0;i+=1while a[i]&&a[i]==b[i];a[0,i]}["global , "glossary"] => "glo" 2.1.5 :002 > ->a,b{i=0;i+=1while a[i]&&a[i]==b[i];a[0,i]}["department", "depart"] => "depart" 2.1.5 :003 > ->a,b{i=0;i+=1while a[i]&&a[i]==b[i];a[0,i]}["glove", "dove"] => ""