Expand description
str Utils
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`
Traits
- To extend types which implement
AsRef<[u8]>
to haveends_with_ignore_ascii_case
,ends_with_ignore_ascii_case_with_lowercase
andends_with_ignore_ascii_case_with_uppercase
methods. - To extend types which implement
AsRef<[u8]>
to haveends_with_ignore_ascii_case_multiple
,ends_with_ignore_ascii_case_with_lowercase_multiple
andends_with_ignore_ascii_case_with_uppercase_multiple
methods. - To extend types which implement
AsRef<str>
to have aends_with_ignore_case
method. - To extend types which implement
AsRef<[u8]>
to have aends_with_multiple
method. - To extend types which implement
AsRef<[u8]>
to haveeq_ignore_ascii_case_with_lowercase
andeq_ignore_ascii_case_with_uppercase
methods. - To extend types which implement
AsRef<[u8]>
to haveeq_ignore_ascii_case_multiple
,eq_ignore_ascii_case_with_lowercase_multiple
andeq_ignore_ascii_case_with_uppercase_multiple
methods. - To extend types which implement
AsRef<str>
to have aeq_ignore_case
method. - To extend types which implement
AsRef<[u8]>
to have aeq_multiple
method. - To extend types which implement
AsRef<[u8]>
to havestarts_with_ignore_ascii_case
,starts_with_ignore_ascii_case_with_lowercase
andstarts_with_ignore_ascii_case_with_uppercase
methods. - To extend types which implement
AsRef<[u8]>
to havestarts_with_ignore_ascii_case_multiple
,starts_with_ignore_ascii_case_with_lowercase_multiple
andstarts_with_ignore_ascii_case_with_uppercase_multiple
methods. - To extend types which implement
AsRef<str>
to have astarts_with_ignore_case
method. - To extend types which implement
AsRef<[u8]>
to have astarts_with_multiple
method.