Function getLCP

  • Returns the length of the longest common prefix between two strings.

    Parameters

    • str1: string

      The first string to compare.

    • str2: string

      The second string to compare.

    Returns number

    The length of the longest common prefix between the two strings.