Top
Back: sqrfree
Forward: sres
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.134 sprintf

Procedure from library standard.lib (see standard_lib).

Syntax:
sprintf ( string_expression [, any_expressions ] )

Return:
string

Purpose:
sprintf(fmt,...); performs output formatting. The first argument is a format control string. Additional arguments may be required, depending on the content of the control string. A series of output characters is generated as directed by the control string; these characters are returned as a string.
The control string fmt is simply text to be copied, except that the string may contain conversion specifications.
Type help print; for a listing of valid conversion specifications. As an addition to the conversions of print, the %n and %2 conversion specification does not consume an additional argument, but simply generates a newline character.

Note:
If one of the additional arguments is a list, then it should be wrapped in an additional list() command, since passing a list as an argument flattens the list by one level.

Example:
 
See also: fprintf; print; printf; string.


Top Back: sqrfree Forward: sres FastBack: Functions and system variables FastForward: Control structures Up: Functions Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-6, Dec 2012, generated by texi2html.