Macro nom::take_str [−][src]
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")));