Replace a character with another in a string.
String_Type strsub (String_Type s, Integer_Type pos, Integer_Type ch)
The strsub character may be used to substitute the character
ch for the character at position pos of the string
s. The resulting string is returned.
define replace_spaces_with_comma (s)
{
variable n;
while (n = is_substr (s, " "), n) s = strsub (s, n, ',');
return s;
}
For uses such as this, the strtrans function is a better choice.
The first character in the string s is specified by pos
equal to 1.
- slangrtl
-
array_map,
bstrlen,
extract_element,
getenv,
init_char_array,
is_list_element,
is_substr,
length,
str_replace,
strlen,
strncmp,
strreplace,
strtrans,
substr
|