Module Printf


module Printf = struct ... end 
Functions

fprintf : Pervasives.out_channel -> ('c, Pervasives.out_channel, unit) format -> 'c
fprintf outchan format arg1 ... argN formats the arguments arg1 to argN according to the format string format, and outputs the resulting string on the channel outchan.
The format is a character string which contains two types of objects: plain characters, which are simply copied to the output channel, and conversion specifications, each of which causes conversion and printing of one argument.
Conversion specifications consist in the % character, followed by optional flags and field widths, followed by one conversion character. The conversion characters and their meanings are: Warning: if too few arguments are provided, for instance because the printf function is partially applied, the format is immediately printed up to the conversion of the first missing argument; printing will then resume when the missing arguments are provided. For example, List.iter (printf "x=%d y=%d " 1) [2;3] prints x=1 y=2 3 instead of the expected x=1 y=2 x=1 y=3. To get the expected behavior, do List.iter (fun y -> printf "x=%d y=%d " 1 y) [2;3].

printf : ('d, Pervasives.out_channel, unit) format -> 'd
Same as fprintf, but output on stdout.

eprintf : ('e, Pervasives.out_channel, unit) format -> 'e
Same as fprintf, but output on stderr.

sprintf : ('f, unit, string) format -> 'f
Same as fprintf, but instead of printing on an output channel, return a string containing the result of formatting the arguments.

bprintf : Buffer.t -> ('g, Buffer.t, unit) format -> 'g
Same as fprintf, but instead of printing on an output channel, append the formatted arguments to the given extensible buffer (see module Buffer).