Function memx::memrmem

source ·
pub fn memrmem(haystack: &[u8], needle: &[u8]) -> Option<usize>
Expand description

This mimics libc::memrmem(), same as (haystack as &str).rfind(needle as &str) or haystack.windows(needle.len()).rposition(|window| window == needle).

This memrmem() function is implemented using stochastic naive algorithm. ref.) The optimized naive string-search algorithm