Crate twoway[][src]

Fast substring search for strings and byte strings, using the two-way algorithm.

This is the same code as is included in Rust’s libstd that powers str::find(&str), but here it is exposed with some improvements:

Functions

find_bytes

find_bytes finds the first ocurrence of pattern in the text.

find_str

find_str finds the first ocurrence of pattern in the text.

rfind_bytes

rfind_bytes finds the last ocurrence of pattern in the text, and returns the index of the start of the match.

rfind_str

rfind_str finds the last ocurrence of pattern in the text and returns the index of the start of the match.