How to Skip some field/word in formattRead?

Ky-Anh Huynh saigon at example.net
Sun Sep 17 13:53:26 UTC 2017


Hi,

Is it possible to read just the second word from an input string 
and skip all others?

     "one two three".formattedRead!("%s %s", _, saveme)

The point is I want to skip the first/third word (`one`, `third`) 
and read the second word (`two`) into the variable `saveme`. For 
now I have to declare temporary reference

     string _;
     "one two three".formattedRead!("%s %s %s", _, saveme, _);

Well, `_` is acceptable; in my example, the value of `_` would be 
`three[\n]`

Is there any better/cleaner way?

Thanks for your reading.


More information about the Digitalmars-d-learn mailing list