Provides an iterator over windows of chars (as &str
s) of a &str
.
Does not allocate on the heap.
use str_windows::str_windows;
let input = "s ππ";
let mut iter = str_windows(input, 3);
assert_eq!(iter.next(), Some("s π"));
assert_eq!(iter.next(), Some(" ππ"));
assert!(iter.next().is_none());