Help for this page

Select Code to Download


  1. or download this
    # leading common substring
    # returns length of LCS
    # requires Perl 5.6+
    ...
      ($_[0] ^ $_[1]) =~ /\0*/;
      return $+[0];
    }
    
  2. or download this
    # leading common substring
    # returns length of LCS
    # requires Perl 5.6+
    ...
      ($_[0] ^ $_[1]) =~ /(\0*)/;
      return length $1;
    }