konst::string

Function trim_start_matches

Source
pub const fn trim_start_matches<'a, 'p, P>(this: &'a str, needle: P) -> &'a str
where P: Pattern<'p>,
Expand description

A const subset of str::trim_start_matches.

This takes Pattern implementors as the needle.

ยงExample

use konst::string;

const CHAR_TRIMMED: &str = string::trim_start_matches("#####huh###", '#');
const STR_TRIMMED: &str = string::trim_start_matches("#####huh###", "##");

assert_eq!(CHAR_TRIMMED, "huh###");
assert_eq!(STR_TRIMMED, "#huh###");