scanf method

List scanf(
  1. String format
)

Reads one line from stdin and parses it according to format.

Returns a List of matched values — see sscanf for full documentation.

Example:

// If stdin contains "25 3.8"
final r = stdc.scanf("%d %f");
// r == [25, 3.8]

Implementation

List<dynamic> scanf(String format) {
  final line = stdioReadLineSync() ?? '';
  return sscanf(line, format);
}