Function konst::string::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###");