Re: Problem with std.string.strip(): Can't use result in format routine

2017-09-05 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 13:56:20 UTC, Andrea Fontana wrote: I used `lines(stdin)` as in https://dlang.org/phobos/std_stdio.html#.lines . My source code is here https://github.com/icy/dusybox/blob/master/src/plotbar/main.d#L47 . Thanks for your support. I think formattedRead is

Re: Problem with std.string.strip(): Can't use result in format routine

2017-09-05 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 13:40:18 UTC, Ky-Anh Huynh wrote: On Tuesday, 5 September 2017 at 13:17:34 UTC, Azi Hassan wrote: 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 ? I used `lines(stdin)` as in

Re: Problem with std.string.strip(): Can't use result in format routine

2017-09-05 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 13:17:34 UTC, Azi Hassan wrote: 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 ? I used `lines(stdin)` as in https://dlang.org/phobos/std_stdio.html#.lines . My source code

Re: Problem with std.string.strip(): Can't use result in format routine

2017-09-05 Thread Azi Hassan via Digitalmars-d-learn
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",

Problem with std.string.strip(): Can't use result in format routine

2017-09-05 Thread Ky-Anh Huynh via Digitalmars-d-learn
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