unquote


Description:

public string unquote (string quoted_string) throws ShellError

Example: Unquote a string:

public static int main (string[] args) {
// Output: ``my str``
try {
string str = Shell.unquote ("my str");
print ("%s\n", str);
} catch (ShellError e) {
print ("Error: %s\n", e.message);
}

// Output: ``my str``
try {
string str = Shell.unquote ("'my str'");
print ("%s\n", str);
} catch (ShellError e) {
print ("Error: %s\n", e.message);
}

// Output: ``Error: Unmatched quotation mark in command line or other shell-quoted text``
try {
string str = Shell.unquote ("'my str");
print ("%s\n", str);
} catch (ShellError e) {
print ("Error: %s\n", e.message);
}

return 0;
}

valac --pkg glib-2.0 GLib.Shell.unquote.vala


Namespace: GLib.Shell
Package: glib-2.0