formattedRead

fnuint formattedRead(Range, Char, Args...)(auto ref Range r, const(Char)[] fmt, auto ref Args args)

Reads an input range according to a format string and stores the read values into its arguments.

Format specifiers with format character 'd', 'u' and 'c' can take a '*' parameter for skipping values.

The second version of formattedRead takes the format string as template argument. In this case, it is checked for consistency at compile-time.

Parameters

ran input range, where the formatted input is read from
fmta format string
argsa variadic list of arguments where the read values are stored
Rangethe type of the input range r
Charthe character type used for fmt
Argsa variadic list of types of the arguments

Returns

The number of variables filled. If the input range r ends early,

this number will be less than the number of variables provided.

Throws

A FormatException

if reading did not succeed.

Note

For backward compatibility the arguments args can be given as pointers

to that variable, but it is not recommended to do so, because this option might be removed in the future.

fnuint formattedRead(alias fmt, Range, Args...)(auto ref Range r, auto ref Args args) if (!isType!fmt && isSomeString!(typeof(fmt)))

ditto