[][src]Function str_overlap::overlap

pub fn overlap<'a>(left: &str, right: &'a str) -> &'a str

Finds the overlap between two string slices.

The overlap is here defined as the largest substring contained at both the end of left and the beginning of right. If no overlap exists, an empty string is returned.

Example Usage

use string_overlap::overlap;

assert_eq!(overlap("abc", "bcd"), "bc");