Closed atrauzzi closed 1 year ago
Right now it seems to return IEnumerable<char>, which is obviously a precursor to a string. I was wondering if Pidgin had any handy way of doing this, versus me just manually making the string in a Map somewhere later on?
IEnumerable<char>
Map
Does this do what you meant?
static Parser<TToken, string> RepeatString<TToken>(this Parser<TToken, char> p, int n) => p.Repeat(n).Select(string.Concat);
It's cleaner, yes :slightly_smiling_face:
Right now it seems to return
IEnumerable<char>
, which is obviously a precursor to a string. I was wondering if Pidgin had any handy way of doing this, versus me just manually making the string in aMap
somewhere later on?