[][src]Macro nom::take_str

macro_rules! take_str {
    ( $i:expr, $size:expr ) => { ... };
}

take_str!(nb) => &[T] -> IResult<&[T], &str> same as take! but returning a &str

Example

 named!(take5( &[u8] ) -> &str, take_str!( 5 ) );

 let a = b"abcdefgh";

 assert_eq!(take5(&a[..]), Ok((&b"fgh"[..], "abcde")));