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

pub fn similar<S>(orig: S) -> DifferencePredicate where
    S: Into<Cow<'static, str>>, 

Creates a new Predicate that checks strings for how similar they are.

Examples

use predicates::prelude::*;

let predicate_fn = predicate::str::similar("Hello World");
assert_eq!(true, predicate_fn.eval("Hello World"));
assert_eq!(false, predicate_fn.eval("Goodbye World"));