#string #chunks #str-chunks

str-chunks

implements char-wise chunked iteration of str

2 unstable releases

0.2.0 Jan 15, 2025
0.1.0 Jan 11, 2025

#46 in #chunks

Download history 83/week @ 2025-01-16 3/week @ 2025-02-06 147/week @ 2025-02-13 256/week @ 2025-02-20 182/week @ 2025-02-27 180/week @ 2025-03-06 105/week @ 2025-03-13 152/week @ 2025-03-20 69/week @ 2025-03-27 386/week @ 2025-04-03 95/week @ 2025-04-10 2/week @ 2025-04-17

177 downloads per month

Custom license

36KB
492 lines

str chunks

implements char-wise chunked iteration of str

the methods str_chunks, str_chunks_exact, str_rchunks, and str_rchunks_exact behave like the similarly named methods on slice, but return string slices that are chunk_size chars long. take note: these slices are not necessarily chunk_size bytes long. chunk.len() != chunk_size

import ImplStrChunks to get methods on &str

For DoubleEndedIterator support, use the reversable method. This is not a trivial operation, and it is recommended to avoid it if possible.


str-chunks

GitHub last commit Crates.io Docs.rs

About

implements char-wise chunked iteration of str

the methods str_chunks, str_chunks_exact, str_rchunks, and str_rchunks_exact behave like the similarly named methods on slice, but return string slices that are chunk_size chars long. take note: these slices are not necessarily chunk_size bytes long. chunk.len() != chunk_size

import ImplStrChunks to get methods on str

Usage

Add to your Cargo.toml:

[dependencies]
str-chunks = "0.1.1"

See docs.rs for examples.

or just copy src/str_chunks.rs into your own project. im not your mom. dont forget to remove the #![no_std]

No runtime deps