This crate provides a utility function for finding the overlap between two string slices.
The overlap is here defined as the largest substring contained both at the end of the first string slice and the beginning of the second string slice.
To use this crate, call the provided overlap
function with two string slices in the left and
right positions.
```rust use str_overlap::overlap;
assert_eq!(overlap("abc", "bcd"), "bc"); ```
Note that the positions of the string slices matter. The overlap found is the largest substring at both the end of the left string slice and the beginning of the right string slice.
The overlap
function has temporal complexity O(n) in the worst case (where no overlap is found),
where n is the length of the first string parameter.
This crate is guaranteed to compile on stable rustc 1.0.0
and up.
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.