Function predicates::str::contains
source · pub fn contains<P>(pattern: P) -> ContainsPredicate
Expand description
Creates a new Predicate
that ensures a str contains pattern
§Examples
use predicates::prelude::*;
let predicate_fn = predicate::str::contains("Two");
assert_eq!(true, predicate_fn.eval("One Two Three"));
assert_eq!(false, predicate_fn.eval("Four Five Six"));