#string #text #utility #array #no-std

no-std split_exact

splitting strings into arrays of slices

4 releases (2 stable)

1.1.0 Apr 11, 2024
1.0.0 Apr 10, 2024
0.2.0 Mar 17, 2024
0.1.0 Mar 15, 2024

#1638 in Rust patterns

Download history 251/week @ 2024-03-12 43/week @ 2024-03-19 2/week @ 2024-03-26 28/week @ 2024-04-02 260/week @ 2024-04-09

352 downloads per month

MIT/Apache

5KB

split_exact

Implements splitting at patterns into exactly N destructurable slices.

Until Pattern API is stabilized, this crate currently only supports single character separators.

Usage

let header = "GET / HTTP/1.1";
let [method, path, http] = header.split_exact(char::is_whitespace);

Also with variant that returns remainder slice.

License

MIT OR Apache-2.0

No runtime deps