Function konst::string::rcontains

source ·
pub const fn rcontains<'a, P>(left: &str, pat: P) -> bool
where 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"));