Format objects into a string
String_Type Sprintf (String_Type format, ..., Integer_Type n)
Sprintf
formats a string from n
objects according to
format
. Unlike sprintf
, the Sprintf
function
requires the number of items to format.
s = Sprintf("%f is greater than %f but %s is better than %s\n",
PI, E, "Cake" "Pie", 4);
The final argument to Sprintf
is the number of items to format; in
this case, there are 4 items.
sprintf, string