pub const fn rcontains<'a, P>(left: &str, pat: P) -> boolwhere
P: Pattern<'a>,
Expand description
A const equivalent of
str::contains
, taking a Pattern
parameter.
ยงExample
use konst::string;
assert!(string::rcontains("foo-bar-baz", '-'));
assert!(!string::rcontains("foo-bar-baz", 'q'));
assert!(!string::rcontains("bar-baz", "foo"));
assert!(string::rcontains("foo-bar", "foo"));