Timon Gehr:

> readln() includes the trailing newline character in the resulting 
> string. You can use std.string.strip to remove leading and trailing 
> whitespace:

Time ago I have asked Andrei to modify the to!int conversion to work as Python, 
ignoring leading and trailing whitespace:

>>> s = "123\n"
>>> int(s)
123

But he didn't change it. I don't think people use parse at their first try.

Bye,
bearophile

Reply via email to