[][src]Macro nom::take_s

macro_rules! take_s {
    ($i:expr, $count:expr) => { ... };
}
Deprecating in 4.0.0

: Please use take instead

take_s!(nb) => &str -> IResult<&str, &str> generates a parser consuming the specified number of characters

 // Desmond parser
 named!(take5<&str,&str>, take_s!( 5 ) );

 let a = "abcdefgh";

 assert_eq!(take5(a),Ok(("fgh", "abcde")));

 let b = "12345";

 assert_eq!(take5(b),Ok(("", "12345")));