[][src]Function cs::longest_common_substring

pub fn longest_common_substring<T: AsRef<str>>(strs: &[T]) -> String

Compute the longest common substring among a slice of strings

Example

use cs::longest_common_substring;
let lcs = longest_common_substring(&[
    "ZYABCAGB",
    "BCAGDTZYY",
    "DACAGZZYSC",
    "CAGYZYSAU",
    "CAZYUCAGF",
]);
assert_eq!(lcs, "CAG");