append_vprintf
Description:
Appends a formatted string onto the end of a StringBuilder.
This function is similar to append_printf except that the arguments to the format string are passed as a va_list.
Example: Append a formatted string (va_list):
[PrintfFormat]
public static string mysprintf (string str, ...) {
va_list va_list = va_list ();
StringBuilder builder = new StringBuilder ();
builder.append_vprintf (str, va_list);
return (owned) builder.str;
}
public static int main (string[] args) {
// Output: ``hello, world!``
string str = mysprintf ("%s%s%s%s\n", "hello", ", ", "world", "!");
print (str);
return 0;
}
valac --pkg glib-2.0 GLib.StringBuilder.append_vprintf.vala
Parameters:
this | |
format |
the string format. See the printf documentation |
args |
the list of arguments to insert in the output |