sprintf/3—format a series of values into a string
The sprintf/3 function formats a series of values into a string. The syntax of this function is as follows:
sprintf($STR,$FORMAT,$ARGS)
$STR=sprintf($FORMAT,$ARGS)
$STR=sprintf($FORMAT,$ARGS)
sprintf/3 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$FORMAT | Input | STRING | Specifies the format for the resulting string |
$ARGS | Input | LIST_OF ANY | Specifies the arguments to be printed as a string |
$STR | Output | STRING | Resulting string |
Use the sprintf/3 function to print a list of arguments specified in $ARGS into the $STR argument using the format specified in $FORMAT.
The format specification for sprintf/3 is the same as for the C language sprintf() function.
sprintf/3 example
sprintf($E.msg,'Event #%x',[$E.event_handle]);
The msg slot is set to the event number in hexadecimal notation (%x format).
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*