Function wmemchr::naive::wmemchr [−][src]
pub fn wmemchr<T: Wide>(needle: T, haystack: &[T]) -> Option<usize>
Expand description
Returns the index of the first occurrence of a wide character in a slice,
or None
if the character is not found.
Examples
Basic usage:
use wchar::wch; use wmemchr::naive::wmemchr; let haystack = wch!(u16, "foo bar"); assert_eq!(wmemchr(wch!(u16, 'o'), haystack), Some(1)); assert_eq!(wmemchr(wch!(u16, 'z'), haystack), None);