bytecount

Function naive_count

Source
pub fn naive_count(utf8_chars: &[u8], needle: u8) -> usize
Expand description

Count 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(s, b' ');
assert_eq!(number_of_spaces, 6);