Starts/Ends With Caseless

Build Status Build status

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.

Examples

```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")); ```

Multiple Prefixes or Suffixes

This crates also provides the StartsWithCaselessMultiple trait and the EndsWithCaselessMultiple trait to do starts_with_caseless and ends_with_caseless with multiple prefixes or suffixes.

Example

```rust extern crate startsendswith_caseless;

use startsendswith_caseless::StartsWithCaselessMultiple;

asserteq!(true, "foobar".startswithcaselessascii_multiple(&["foo", "bar"])); ```

No Std

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"]

Crates.io

https://crates.io/crates/starts-ends-with-caseless

Documentation

https://docs.rs/starts-ends-with-caseless

License

MIT