On Tuesday, 5 September 2017 at 12:38:54 UTC, Ky-Anh Huynh wrote:
Hi,

I read line from STDIN , and strip them

[code]
auto line_st = line.strip();
[/code]


However, I can't use result in another format routine. Assume my input line is "foobar":

[code]
writeln("Stripped line is %s", line_st);
[/code]

This code only prints "Stripped line is ". If I use instead

[code]
writeln("Stripped line is %s", line.strip());
[/code]

the result is "Stripped line is foobar".

What're the difference between the two uses? I'm using `dmd v2.075.1`.

Thanks a lot.

Maybe it has something to do with how you read from STDIN. Can you show that part of the code to see if I can reproduce the issue ?

Reply via email to