1 stable release

1.0.0 Nov 21, 2020

#1463 in Text processing

Download history 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 289/week @ 2024-04-17 174/week @ 2024-04-24 186/week @ 2024-05-01 168/week @ 2024-05-08 126/week @ 2024-05-15 111/week @ 2024-05-22 173/week @ 2024-05-29 156/week @ 2024-06-05 152/week @ 2024-06-12 124/week @ 2024-06-19 126/week @ 2024-06-26

591 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