to_string


Description:

[ CCode ( cname = "g_strdup_printf" , instance_pos = -1 ) ]
public string to_string (string format = "%g")

Similar to the standard C `sprintf()` function but safer, since it calculates the maximum space required and allocates memory to hold the result.

The returned string is guaranteed to be non-NULL, unless format contains `lc` or ` ls` conversions, which can fail if no multibyte representation is available for the given character.

Parameters:

format

a standard `printf()` format string, but notice [string precision pitfalls](string-utils.html#string-precision-pitfalls)

...

the parameters to insert into the format string

Returns:

a newly-allocated string holding the result