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§
- Ends
With Ignore Ascii Case - 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. - Ends
With Ignore Ascii Case Multiple - 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. - Ends
With Ignore Case - To extend types which implement
AsRef<str>
to have aends_with_ignore_case
method. - Ends
With Multiple - To extend types which implement
AsRef<[u8]>
to have aends_with_multiple
method. - EqIgnore
Ascii Case - To extend types which implement
AsRef<[u8]>
to haveeq_ignore_ascii_case_with_lowercase
andeq_ignore_ascii_case_with_uppercase
methods. - EqIgnore
Ascii Case Multiple - 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. - EqIgnore
Case - To extend types which implement
AsRef<str>
to have aeq_ignore_case
method. - EqMultiple
- To extend types which implement
AsRef<[u8]>
to have aeq_multiple
method. - Starts
With Ignore Ascii Case - 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. - Starts
With Ignore Ascii Case Multiple - 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. - Starts
With Ignore Case - To extend types which implement
AsRef<str>
to have astarts_with_ignore_case
method. - Starts
With Multiple - To extend types which implement
AsRef<[u8]>
to have astarts_with_multiple
method.