sprintf
Returns the formatted string
sprintf()
function writes the formatted string into a variable.
The arg1 , arg2 , ++ parameters will be inserted at the percent sign (%) symbol in the main string. This function is executed step by step. At the first % symbol, insert arg1 , at the second % symbol, insert arg2 , and so on.
Note: If the % symbol is more than the arg parameter, you must use placeholders. The placeholder is behind the % symbol and consists of a number and "\$". See Example 2.
fprintf()
printf()
vfprintf()
vprintf()
vsprintf()
sprintf ( format , arg1 , arg2 , arg ++ )
parameter | describe |
---|---|
format |
Required. Specifies the string and how to format the variables in it. Possible format values:
Additional format value. Necessarily placed between % and letters (for example %.2f):
Note: If you use multiple format values above, they must be used in the above order. |
arg1 | Required. Specifies the parameters inserted into the first % symbol in the format string. |
arg2 | Optional. Specifies the parameter inserted into the second % symbol in the format string. |
arg++ | Optional. Specifies the parameters inserted into the third and fourth % symbols in the format string. |