str-utils

Crates.iostr-utils
lib.rsstr-utils
version0.1.7
sourcesrc
created_at2020-07-18 19:32:08.965832
updated_at2023-09-11 02:45:02.409954
descriptionThis crate provides some traits to extend types which implement `AsRef<[u8]>` or `AsRef`.
homepagehttps://magiclen.org/str-utils
repositoryhttps://github.com/magiclen/str-utils
max_upload_size
id266657
size30,035
Magic Len (Ron Li) (magiclen)

documentation

README

str Utils

CI

This crate provides some traits to extend types which implement AsRef<[u8]> or AsRef<str>.

Examples

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

Commit count: 12

cargo fmt