| Did you know ... | Search Documentation: |
| string->format |
<-value
of the string object
using formatted output. Formatting is based on the C-language printf()
standard library function. Argument objects are converted to the type
requested by the format statement.
If you have an implementation of the C-language on your computer, you may wish to check the documentation of printf (Unix: man printf).
Various other classes implement the string->format
method. See also
editor->format, text_buffer->format, pce->format.
Prolog formatting may be used as an alternative by exploiting pce_open/3:
..., pce_open(View, append, Stream), format(Stream, 'Hello ~d-th ~w~n', [100, world]), close(Stream), ...
The format argument to string->format
is a string with two types of control-arguments. The % sign introduces a
conversion statement, while the \ character introduces a
special character. The % sign is optionally followed by a numeric
argument, controlling the output.