readf

fnuint readf(alias format, A...)(auto ref A args) if (isSomeString!(typeof(format)))

Reads formatted data from stdin using formattedRead.

Parameters

formatThe format string. When passed as a compile-time argument, the string will be statically checked against the argument types passed.
argsItems to be read.

Returns

Same as formattedRead: The number of variables filled. If the input range r ends early,

this number will be less than the number of variables provided. Example: ---- // test.d void main() { import std.stdio; foreach (_; 0 .. 3) { int a; readf!" %d"(a); writeln(++a); } } ----

% echo "1 2 3" | rdmd test.d

2 3 4

fnuint readf(A...)(scope const(char)[] format, auto ref A args)

ditto