Function predicates::prelude::predicate::str::contains[][src]

pub fn contains<P>(pattern: P) -> ContainsPredicate where
    P: Into<String>, 

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