I'm using 'Token()' method to discard leading and trailing whitespaces but it won't, this test fails with message
Expected string to be "token", but it has unexpected whitespace at the end.
I tried to call method Token()
before method Text()
but it won't help too.
Parse.AnyChar.Many().Token().Text()
How do I use method Token()
in a right way?
[Test]
public void Test()
{
Parser<string> parser = Parse.AnyChar.Many().Text().Token();
var actual = parser.Parse(" token ");
actual.Should().Be("token"); // without leading and trailing whitespaces
}