This crate provides the StartsWithCaseless
trait and the EndsWithCaseless
trait to extend types which implement AsRef<str>
in order to do starts_with
and ends_with
case-insensitively.
```rust extern crate startsendswith_caseless;
use startsendswith_caseless::StartsWithCaseless;
asserteq!(true, "foobar".startswithcaselessascii("FoO"));
asserteq!(true, "Maße 123".startswith_caseless("MASSE")); ```
```rust extern crate startsendswith_caseless;
use startsendswith_caseless::EndsWithCaseless;
asserteq!(true, "foobar".endswithcaselessascii("BaR"));
asserteq!(true, "123 Maße".endswith_caseless("MASSE")); ```
This crate also provides the StartsWithCaselessMultiple
trait and the EndsWithCaselessMultiple
trait to do starts_with_caseless
and ends_with_caseless
with multiple prefixes or suffixes.
```rust extern crate startsendswith_caseless;
use startsendswith_caseless::StartsWithCaselessMultiple;
asserteq!(true, "foobar".startswithcaselessascii_multiple(&["foo", "bar"])); ```
This crate can work without std, but the starts_with_caseless
method and the ends_with_caseless
method will be disabled at this stage as well as the StartsWithCaselessMultiple
trait and the EndsWithCaselessMultiple
trait.
Enable the feature no_std to compile this crate without std.
toml
[dependencies.starts-ends-with-caseless]
version = "*"
features = ["no_std"]
https://crates.io/crates/starts-ends-with-caseless
https://docs.rs/starts-ends-with-caseless