December 27, 2015 Re: basic interactive readf from stdin | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Sunday, 27 December 2015 at 00:20:51 UTC, Ali Çehreli wrote:
> On 12/26/2015 12:11 PM, karthikeyan wrote:
>
> > I read http://ddili.org/ders/d.en/input.html and inserted a
> space before %s
> > but still no use. Am I missing something here with the latest
> version?
>
> The answer is nine chapters later. :) (Use readln() and strip() (or chomp())).
>
> http://ddili.org/ders/d.en/strings.html
>
> Ali
Yes, thank you, strip() appears to be more useful than chomp() in this case.
|
December 27, 2015 Re: basic interactive readf from stdin | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Sunday, 27 December 2015 at 00:20:51 UTC, Ali Çehreli wrote:
> On 12/26/2015 12:11 PM, karthikeyan wrote:
>
> > I read http://ddili.org/ders/d.en/input.html and inserted a
> space before %s
> > but still no use. Am I missing something here with the latest
> version?
>
> The answer is nine chapters later. :) (Use readln() and strip() (or chomp())).
>
> http://ddili.org/ders/d.en/strings.html
>
> Ali
Many thanks Ali. The book says ctrl + D to end input. But I used two enters to get the output. Any idea why? The book was great. Thanks a lot.
|
December 26, 2015 Re: basic interactive readf from stdin | ||||
---|---|---|---|---|
| ||||
Posted in reply to Karthikeyan | On 12/26/2015 05:15 PM, Karthikeyan wrote: >> The answer is nine chapters later. :) (Use readln() and strip() (or >> chomp())). >> >> http://ddili.org/ders/d.en/strings.html >> >> Ali > > Many thanks Ali. The book says ctrl + D to end input. But I used two > enters to get the output. Any idea why? I guess that means that my understanding was not portable. It requires Ctrl-D on my console environment on Linux. No matter how many Enters I enter :p they become parts of the same string. Ali |
December 27, 2015 Re: basic interactive readf from stdin | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Sunday, 27 December 2015 at 02:08:05 UTC, Ali Çehreli wrote:
> On 12/26/2015 05:15 PM, Karthikeyan wrote:
>
> >> The answer is nine chapters later. :) (Use readln() and
> strip() (or
> >> chomp())).
> >>
> >> http://ddili.org/ders/d.en/strings.html
> >>
> >> Ali
> >
> > Many thanks Ali. The book says ctrl + D to end input. But I
> used two
> > enters to get the output. Any idea why?
>
> I guess that means that my understanding was not portable. It requires Ctrl-D on my console environment on Linux. No matter how many Enters I enter :p they become parts of the same string.
>
> Ali
:) I was on zsh with gnome terminal alike on Linux Mint 15. Thanks for clearing that up.
|
Copyright © 1999-2021 by the D Language Foundation