1 stable release

1.0.0 Nov 21, 2020

#1640 in Text processing

Download history 118/week @ 2024-08-26 164/week @ 2024-09-02 151/week @ 2024-09-09 105/week @ 2024-09-16 147/week @ 2024-09-23 133/week @ 2024-09-30 74/week @ 2024-10-07 163/week @ 2024-10-14 186/week @ 2024-10-21 259/week @ 2024-10-28 177/week @ 2024-11-04 124/week @ 2024-11-11 141/week @ 2024-11-18 181/week @ 2024-11-25 172/week @ 2024-12-02 281/week @ 2024-12-09

787 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