Function combine::parser::char::string

source ·
pub fn string<'a, Input>(
    s: &'static str
) -> impl Parser<Input, Output = &'a str>
where Input: Stream<Token = char>,
Expand description

Parses the string s.

let result = string("rust")
    .parse("rust")
    .map(|x| x.0);
assert_eq!(result, Ok("rust"));