konst::string

Function 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'));