sprintf function
String
sprintf(
- String template,
- List values
Replaces %d and %s in template with values
Implementation
String sprintf(String template, List<dynamic> values) {
int i = 0;
return template.replaceAllMapped(
RegExp(r"%[sd]"),
(_) => values[i++].toString(),
);
}