Functions
str.replace()
Returns a new string with the Nth occurrence of the target string replaced by the replacement string, where N is specified in occurrence.
Syntax · 1 of 4
str.replace(const string source, const string old, const string new, const int count) → const string
Arguments
source required const string Source string. old required const string String to be inserted instead of the target string. new required const string String to be replaced. count const int N-th occurrence of the target string to replace. Indexing starts at 0 for the first match. Optional. Default value is 0. Return Type
const string Syntax · 2 of 4
str.replace(input string source, input string old, input string new, input int count) → input string
Arguments
source required input string Source string. old required input string String to be inserted instead of the target string. new required input string String to be replaced. count input int N-th occurrence of the target string to replace. Indexing starts at 0 for the first match. Optional. Default value is 0. Return Type
input string Syntax · 3 of 4
str.replace(simple string source, simple string old, simple string new, simple int count) → simple string
Arguments
source required simple string Source string. old required simple string String to be inserted instead of the target string. new required simple string String to be replaced. count simple int N-th occurrence of the target string to replace. Indexing starts at 0 for the first match. Optional. Default value is 0. Return Type
simple string Syntax · 4 of 4
str.replace(series string source, series string old, series string new, series int count) → series string
Arguments
source required series string Source string. old required series string String to be inserted instead of the target string. new required series string String to be replaced. count series int N-th occurrence of the target string to replace. Indexing starts at 0 for the first match. Optional. Default value is 0. Return Type
series string Example
indicator(str.replace("GoCharting is great!", "great", "awesome"), overlay=false)
plot(close)