str.replace_all
Substitutes new text for every occurrence of the old text. It takes no count. That is the difference between it and str.replace, which does.
str.replace_all(const string source, const string old, const string new) → const stringstr.replace_all(input string source, input string old, input string new) → input stringstr.replace_all(series string source, series string old, series string new) → series stringstr.replace_all(simple string source, simple string old, simple string new) → simple string| Parameter | Type | Required | Description |
|---|---|---|---|
source | const string | yes | the string to work on |
old | const string | yes | the text to replace |
new | const string | yes | the text to put in its place |
Returns const string or input string or series string or simple string — A string in the form of the arguments you pass.
indicator("Every replacement")
alert(str.replace_all("a-b-c", "-", ":"))
plot(close)See also str.contains · str.endswith · str.format_time
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.