Trait odds::string::StrChunksWindows [] [src]

pub trait StrChunksWindows {
    fn char_chunks(&self, n: usize) -> CharChunks;
    fn char_windows(&self, n: usize) -> CharWindows;

Extension traits for the char_chunks and char_windows methods

Required Methods

Return an iterator that splits the string in substrings of each n char per substring. The last item will contain the remainder if n does not divide the char length of the string evenly.

Return an iterator that produces substrings of each n char per substring in a sliding window that advances one char at a time.

Panics if n is zero.