sprintf
sprintf(
{s_Var | nil }
t_formatString
[ g_arg1 ... ]
)
=> t_string
Description
Formats the output and assigns the resultant string to the variable given as the first argument.
If nil is specified as the first argument, no assignment is made, but the formatted string is returned.
Arguments
|
Arguments following the format string are printed according to their corresponding format specifications. |
Value Returned
Examples
sprintf(s "Memorize %s number %d!" "transaction" 5)
=> "Memorize transaction number 5!"
s
=> "Memorize transaction number 5!"
p = outfile(sprintf(nil "test%d.out" 10))
=> port:"test10.out"
Related Topics
Return to top