1 stable release

1.0.0 Nov 21, 2020

#1598 in Text processing

Download history 158/week @ 2024-07-20 177/week @ 2024-07-27 126/week @ 2024-08-03 205/week @ 2024-08-10 113/week @ 2024-08-17 94/week @ 2024-08-24 145/week @ 2024-08-31 183/week @ 2024-09-07 109/week @ 2024-09-14 139/week @ 2024-09-21 143/week @ 2024-09-28 82/week @ 2024-10-05 162/week @ 2024-10-12 171/week @ 2024-10-19 257/week @ 2024-10-26 168/week @ 2024-11-02

785 downloads per month
Used in 5 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