Absolute beginner

bearophile bearophileHUGS at lycos.com
Fri Jan 13 13:56:57 PST 2012


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


More information about the Digitalmars-d-learn mailing list