MathTop

longest_common_substring 函数

返回两个字符串共有的最长连续子串。

语法

  • LongestCommonSubString(text1, text2)
  • longest_common_substring(text1, text2)

参数与选项

text1第一个文本。
text2第二个文本。

示例

  1. 最长公共子串LongestCommonSubString('abracadabra', 'cadet')返回 cad。