string_replace_all

Declaration

string_replace_all :: fn (str: string, c: u8, with := '\0') s32

Description

Replace all found occurrences of character c in the input string with with character and return count of replacements made. This function cannot be used with constant string literals as input.

Arguments

  • str Input string.

  • c Character to be replaced.

  • with Replacement. If replacement is 0 character, all c occourences will be erased from the string.

Result

Count of replacements made.

Declared in: string.bl