@technobuddha/library
Version:
A large library of useful functions
18 lines (17 loc) • 706 B
TypeScript
declare type Options = {
/** compare the two strings in case insensitive mode */
caseInsensitive?: boolean;
};
/**
* Implementation of Longest Common Substring problem.
* https://en.wikipedia.org/wiki/Longest_common_substring_problem
*
* Returns the longest possible substring that is substring of both of given strings.
*
* @param array1 First string.
* @param array2 Second string.
* @returns A string that is common to both strings such that there is no
* common substring with size greater than the length of the string.
*/
export declare function longestCommonSubstring(string1: string, string2: string, { caseInsensitive }?: Options): string;
export default longestCommonSubstring;