#iterator #str #string #windows #window

str_windows

Provides an iterator over windows of chars (as &strs) of a &str

1 unstable release

Uses old Rust 2015

0.1.0 Jun 2, 2018

#96 in #str

MIT/Apache

6KB
58 lines

str_windows-rs

Provides an iterator over windows of chars (as &strs) of a &str.

Does not allocate on the heap.

Examples

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());

No runtime deps