compress


Description:

[ CCode ( cname = "g_strcompress" ) ]
public string compress ()

Replaces all escaped characters with their one byte equivalent.

This function does the reverse conversion of [func@GLib.strescape].

Example: Unescape special characters:

public static int main () {
// Output:
// `` Oh please, don't call me human.``
// `` Just "Doctor" would do very nicely, thank you.``
string escaped = "\\tOh please, don't call me human.\\n\\tJust \\\"Doctor\\\" would do very nicely, thank you.".compress ();
print ("%s\n", escaped);
return 0;
}

valac --pkg glib-2.0 string.compress.vala

Parameters:

source

a string to compress

Returns:

a newly-allocated copy of source with all escaped character compressed