1 stable release

1.0.0 Nov 21, 2020

#1710 in Text processing

Download history 133/week @ 2024-11-16 182/week @ 2024-11-23 164/week @ 2024-11-30 266/week @ 2024-12-07 222/week @ 2024-12-14 109/week @ 2024-12-21 51/week @ 2024-12-28 132/week @ 2025-01-04 258/week @ 2025-01-11 177/week @ 2025-01-18 234/week @ 2025-01-25 645/week @ 2025-02-01 301/week @ 2025-02-08 386/week @ 2025-02-15 262/week @ 2025-02-22 316/week @ 2025-03-01

1,441 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