Crates.io | str_windows |
lib.rs | str_windows |
version | 0.1.0 |
source | src |
created_at | 2018-06-02 13:06:16.953722 |
updated_at | 2018-06-02 13:06:16.953722 |
description | Provides an iterator over windows of chars (as `&str`s) of a `&str`. |
homepage | |
repository | https://github.com/derekdreery/str_windows-rs |
max_upload_size | |
id | 68204 |
size | 15,637 |
str_windows-rs
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());