On this Page

    _sprintf

    (As of 3.0.004.05)

    Format and return string.

    Syntax

    _sprintf(format[, p1[, p2 ... ]])

    Parameters

    format is a template of the text to be returned It is similar to a C sprintf format string where embedded %s, %d, and %f markers that get replaced by parameters passed to _sprintf.

     p1, p2 ... are the optional parameters to be substituted into the format string.

    Returned Value

    The formatted string.

    Description

    See the _printf command for formatting options. This function is identical to the _printf() function except that the resulting string is returned instead of printed.

    Example

     str = _sprintf("name=%s, city=%s", "Tony", "Paris");
     	// sets str to 'name=Tony, city=Paris'

    See Also

    fp.fprintf
    _logf
    _message
    _printf
    _tracef