delimit


Description:

public string delimit (string delimiters, char new_delimiter)

Converts any delimiter characters in string to new_delimiter.

Any characters in string which are found in delimiters are changed to the new_delimiter character.

Example: Replace any delimiter characters with another one:

public static int main (string[] args) {
string str1 = "ABCDEFG";
string str2 = str1.delimit ("ADEG", 'x');

// Output:
// ``ABCDEFG``
// ``xBCxxFx``
print ("%s\n", str1);
print ("%s\n", str2);
return 0;
}

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

Parameters:

delimiters

a string containing the current delimiters, or null to use the standard delimiters defined in G_STR_DELIMITERS

new_delimiter

the new delimiter character

Returns:

a newly-allocated string holding the result