devela::_dep::stringzilla::sz

Function rfind_char_from

pub fn rfind_char_from<H, N>(haystack: H, needles: N) -> Option<usize> 
where H: AsRef<[u8]>, N: AsRef<[u8]>,
Available on crate feature dep_stringzilla only.
Expand description

Finds the index of the last character in haystack that is also present in needles. This can be used to find the last occurrence of any character from a specified set, useful in parsing scenarios such as finding the last delimiter in a string.

§Arguments

  • haystack: The byte slice to search.
  • needles: The set of bytes to search for within the haystack.

§Returns

An Option<usize> representing the index of the last occurrence of any byte from needles within haystack, if found, otherwise None.