Next Previous Contents

57. Sprintf

Synopsis

Format objects into a string

Usage

String_Type Sprintf (String_Type format, ..., Integer_Type n)

Description

Sprintf formats a string from n objects according to format. Unlike sprintf, the Sprintf function requires the number of items to format.

Example

     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.
See Also

sprintf, string


Next Previous Contents