Function konst::string::ends_with

source ·
pub const fn ends_with<'a, P>(left: &str, pat: P) -> bool
where P: Pattern<'a>,
Expand description

A const equivalent of str::ends_with , taking a Pattern parameter.

§Example

use konst::string;

assert!( string::ends_with("foo,bar,baz", ",baz"));
assert!( string::ends_with("abc...z", 'z'));

assert!(!string::ends_with("foo,bar,baz", "bar"));
assert!(!string::ends_with("foo,bar,baz", "foo"));
assert!(!string::ends_with("abc", 'z'));