[−][src]Crate starts_ends_with_caseless
Starts/Ends With Caseless
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
extern crate starts_ends_with_caseless; use starts_ends_with_caseless::StartsWithCaseless; assert_eq!(true, "foobar".starts_with_caseless_ascii("FoO")); assert_eq!(true, "Maße 123".starts_with_caseless("MASSE"));
extern crate starts_ends_with_caseless; use starts_ends_with_caseless::EndsWithCaseless; assert_eq!(true, "foobar".ends_with_caseless_ascii("BaR")); assert_eq!(true, "123 Maße".ends_with_caseless("MASSE"));
Multiple Prefixes or Suffixes
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.
Example
extern crate starts_ends_with_caseless; use starts_ends_with_caseless::StartsWithCaselessMultiple; assert_eq!(true, "foobar".starts_with_caseless_ascii_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.
[dependencies.starts-ends-with-caseless]
version = "*"
features = ["no_std"]
Traits
EndsWithCaseless | To extend types which implement |
EndsWithCaselessMultiple | To extend types which implement |
StartsWithCaseless | To extend types which implement |
StartsWithCaselessMultiple | To extend types which implement |