Example: Replace all occurrences of a string

public static int main (string[] args) {
// Output: ``An apple a day keeps the TARDIS away``
string res = "An apple a day keeps the doctor away".replace ("doctor", "TARDIS");
print ("%s\n", res);
return 0;
}

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

See: