Hacker News new | ask | show | jobs
by losvedir 1897 days ago
I notice that python has `rstrip` while `nim` doesn't. Python's `rstrip()` is allocating a whole new line there. Does the nim iterator skip over whitespace or something? Do those bits of code output the same thing? The presence or absence of the whitespace will affect the `total` count.
1 comments

This is explained a bit further into the article:

> A nice feature of the lines function is that it automatically strips newline characters such as LF and CRLF so we no longer need to doline.rstrip().

Oh, nice! Missed that. Thanks.