1 stable release

1.0.0 Nov 21, 2020

#2189 in Text processing

Download history 109/week @ 2024-12-21 51/week @ 2024-12-28 132/week @ 2025-01-04 258/week @ 2025-01-11 177/week @ 2025-01-18 234/week @ 2025-01-25 645/week @ 2025-02-01 301/week @ 2025-02-08 386/week @ 2025-02-15 259/week @ 2025-02-22 319/week @ 2025-03-01 273/week @ 2025-03-08 384/week @ 2025-03-15 396/week @ 2025-03-22 85/week @ 2025-03-29 135/week @ 2025-04-05

1,039 downloads per month
Used in 6 crates

MIT license

8KB
68 lines

UTF8 Slice

A lightweight heapless way to do slicing on unicode strings in Rust.

What does the library provide

This library provides 4 utility functions to deal with unicode slices.

utf8_slice::slice(s: &str, begin: usize, end: usize) -> &str

This will do the same as &s[begin..end], but now taking into account utf8 characters.

utf8_slice::from(s: &str, begin: usize) -> &str

This will do the same as &s[begin..], but now taking into account utf8 characters.

utf8_slice::till(s: &str, end: usize) -> &str

This will do the same as &s[..end], but now taking into account utf8 characters.

utf8_slice::len(s: &str) -> usize

This will do the same as s.len(), but now taking into account utf8 characters.

Documentation

Link to Documentation

License

MIT

No runtime deps