1 stable release

1.0.0 Nov 21, 2020

#26 in #utf8

Download history 132/week @ 2022-11-29 28/week @ 2022-12-06 15/week @ 2022-12-13 166/week @ 2022-12-20 260/week @ 2022-12-27 52/week @ 2023-01-03 54/week @ 2023-01-10 63/week @ 2023-01-17 58/week @ 2023-01-24 38/week @ 2023-01-31 54/week @ 2023-02-07 104/week @ 2023-02-14 50/week @ 2023-02-21 57/week @ 2023-02-28 51/week @ 2023-03-07 52/week @ 2023-03-14

227 downloads per month
Used in 3 crates

MIT license

7KB
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