printf_escaped


Description:

[ Version ( since = "2.4" ) ]
[ PrintfFormat ]
public string printf_escaped (string format, ...)

Formats arguments according to format, escaping all string and character arguments in the fashion of escape_text.

This is useful when you want to insert literal strings into XML-style markup output, without having to worry that the strings might themselves contain markup.

const char *store = "Fortnum & Mason";
const char *item = "Tea";
char *output;

output = g_markup_printf_escaped ("<purchase>"
"<store>%s</store>"
"<item>%s</item>"
"</purchase>",
store, item);

Parameters:

format

printf style format string

...

the arguments to insert in the format string

Returns:

newly allocated result from formatting operation. Free with g_free.


Namespace: GLib.Markup
Package: glib-2.0