konst::string

Function starts_with

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

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

ยงExample

use konst::string;

assert!( string::starts_with("foo,bar,baz", "foo,"));

assert!(!string::starts_with("foo,bar,baz", "bar"));
assert!(!string::starts_with("foo,bar,baz", "baz"));