1 stable release

1.0.0 Nov 21, 2020

#26 in #utf8

Download history 10/week @ 2022-06-12 28/week @ 2022-06-19 14/week @ 2022-06-26 9/week @ 2022-07-03 20/week @ 2022-07-10 17/week @ 2022-07-17 54/week @ 2022-07-24 39/week @ 2022-07-31 65/week @ 2022-08-07 32/week @ 2022-08-14 70/week @ 2022-08-21 77/week @ 2022-08-28 101/week @ 2022-09-04 43/week @ 2022-09-11 48/week @ 2022-09-18 40/week @ 2022-09-25

236 downloads per month
Used in 2 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