Crate substr_iterator

Source
Expand description

This library is made to iterate over a &str by a number of characters without allocating.

let mut iter = substr_iterator::TrigramIter::from("whatever");
assert_eq!(iter.next(), Some(['w', 'h', 'a']));
let mut iter = substr_iterator::TrigramIter::from("今天我吃饭");
assert_eq!(iter.next(), Some(['今', '天', '我']));

Structs§

  • This is an iterator that allows to take a number of characters out of a string and iterate like a window.

Type Aliases§

  • A set of N characters stored as an array.
  • A set of 3 characters stored as an array.
  • An iterator for only 3 characters. This is just an alias to SubstrIter.