https://github.com/magiclen/str-utils
This crate provides some traits to extend types which implement `AsRef<[u8]>` or `AsRef<str>`.
https://github.com/magiclen/str-utils
rust string
Last synced: 10 months ago
JSON representation
This crate provides some traits to extend types which implement `AsRef<[u8]>` or `AsRef<str>`.
- Host: GitHub
- URL: https://github.com/magiclen/str-utils
- Owner: magiclen
- License: mit
- Created: 2020-07-18T19:31:03.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-29T08:09:53.000Z (about 1 year ago)
- Last Synced: 2025-05-29T09:25:39.884Z (about 1 year ago)
- Topics: rust, string
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
str Utils
====================
[](https://github.com/magiclen/str-utils/actions/workflows/ci.yml)
This crate provides some traits to extend types which implement `AsRef<[u8]>` or `AsRef`.
## Examples
```rust
use str_utils::*;
assert_eq!(true, "foobar".starts_with_ignore_ascii_case("FoO"));
assert_eq!(Some(1), "photo.jpg".ends_with_ignore_ascii_case_multiple(&[".png", ".jpg", ".gif"]));
assert_eq!(true, "http".eq_ignore_ascii_case_with_uppercase("HTTP")); // faster than `eq_ignore_ascii_case`
```
## Crates.io
https://crates.io/crates/str-utils
## Documentation
https://docs.rs/str-utils
## License
[MIT](LICENSE)