Formatted read of tokens?

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 17 07:38:13 PDT 2014


On Tuesday, 17 June 2014 at 13:16:38 UTC, Jerry wrote:
> "bearophile" <bearophileHUGS at lycos.com> writes:
>
>> Jerry:
>>
>>> If I do
>>>
>>> f.readf("%s %s", &l, &i);
>>>
>>> it fails if the whitespace is a tab.
>>
>> In you can use byLine, followed by a split, and then 
>> assignment of the pieces,
>> followed by to!int where necessary.
>
> I actually can't use byLine in this instance.  I'm really 
> wanting the %s
> behavior of scanf().

If you really need/want fscanf behaviour then just use it:

import core.stdc.stdio : fscanf;


More information about the Digitalmars-d-learn mailing list