Calculate the longest common substring of two string.