def length_of_largest_common_substring(str1: str, str2: str) -> int:
    """Find the length of the largest common substring between two strings.

    Args:
        str1: The first string.
        str2: The second string.

    Returns:
        The length of the largest common substring.
    """
    if not str1 or not str2:
        return 0

    # Create a matrix of size (len(str1) + 1) x (len(str2) + 1)
    dp = [[0] * (len(str2) + 1) for _ in range(len(str1) + 1)]

    # Variables to keep track of maximum length and ending position
    max_length = 0

    # Fill the dp matrix
    for i in range(1, len(str1) + 1):
        for j in range(1, len(str2) + 1):
            if str1[i - 1] == str2[j - 1]:
                dp[i][j] = dp[i - 1][j - 1] + 1
                if dp[i][j] > max_length:
                    max_length = dp[i][j]

    return max_length
Find the length of the largest common substring between two strings.

    Args:
        str1: The first string.
        str2: The second string.

    Returns:
        The length of the largest common substring.
    
reflex/utils/format.py