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

pub fn starts_with<P>(pattern: P) -> StartsWithPredicate where
    P: Into<String>, 

Creates a new Predicate that ensures a str starts with pattern

Examples

use predicates::prelude::*;

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