Function bytecount::naive_count_32
source · pub fn naive_count_32(haystack: &[u8], needle: u8) -> usize
Expand description
Count up to (2^32)-1
occurrences of a byte in a slice
of bytes, simple
§Example
let s = b"This is yet another Text with spaces";
let number_of_spaces = bytecount::naive_count_32(s, b' ');
assert_eq!(number_of_spaces, 6);