Next Previous Contents

75. strsub

Synopsis

Replace a character with another in a string.

Usage

String_Type strsub (String_Type s, Integer_Type pos, Integer_Type ch)

Description

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.

Example

    define replace_spaces_with_comma (s)
    {
      variable n;
      while (n = is_substr (s, " "), n) s = strsub (s, n, ',');
      return s;
    }
Notes

The first character in the string s is specified by pos equal to 1.

See Also

is_substr, str_replace, strlen


Next Previous Contents