Example: Replace invalid chars

public static int main (string[] args) {
string str = "glib-2.0";
// Output: ``?????2.0``
str.canon ("0123456789.", '?');
print ("%s\n", str);
return 0;
}

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

See:




2022 vala-language.org