vprintf


Description:

[ Version ( since = "2.14" ) ]
public void vprintf (string format, va_list args)

Writes a formatted string into a StringBuilder.

This function is similar to printf except that the arguments to the format string are passed as a va_list.

Example: Write a formatted string to the builder, va_list:

public static string myprintf (string str, ...) {
va_list va_list = va_list ();
StringBuilder builder = new StringBuilder ("foo bar foo");
builder.vprintf (str, va_list);
return (owned) builder.str;
}

public static int main (string[] args) {
// Output: ``hello, world!``
string str = myprintf ("%s, %s!\n", "hello", "world");
print (str);
return 0;
}

valac --pkg glib-2.0 GLib.StringBuilder.vprintf.vala

Parameters:

this

a StringBuilder

format

the string format. See the printf documentation

args

the parameters to insert into the format string