1 stable release

1.0.0 Nov 21, 2020

#1492 in Text processing

Download history 61/week @ 2024-01-03 84/week @ 2024-01-10 57/week @ 2024-01-17 56/week @ 2024-01-24 89/week @ 2024-01-31 303/week @ 2024-02-07 78/week @ 2024-02-14 66/week @ 2024-02-21 105/week @ 2024-02-28 87/week @ 2024-03-06 193/week @ 2024-03-13 176/week @ 2024-03-20 117/week @ 2024-03-27 180/week @ 2024-04-03 206/week @ 2024-04-10 233/week @ 2024-04-17

758 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