Skip to main content

strip_prefix

Function strip_prefix 

Source
pub fn strip_prefix<'a>(line: &'a str, prefix: &str) -> Option<&'a str>
Expand description

Returns the text after <prefix>: when line starts with prefix (ASCII case-insensitive). Surrounding whitespace / CR LF and spaces before or after the colon are allowed. strip_prefix("+CREG: 1", "+CREG") is Some("1"); "+CREGX: 1" does not match.