Utilities / Reference
alerta.str.replace
TradingView-compatible spelling: str.replace, runs without warnings
Replaces one occurrence of target with replacement — the first unless occurrence says otherwise.
alerta.str.replace(source, target, replacement, occurrence) → series stringParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source | series string | Yes | — | Source string. |
target | series string | Yes | — | Target to replace. |
replacement | series string | Yes | — | Replacement string. |
occurrence | series int | No | — | Which occurrence of target to replace, counting from 0 (the first). The source comes back unchanged when there are fewer. Default 0. |
Returns
series stringExample
alerta.str.replace
indicator("Replace Example")// Remove BINANCE: prefix from the symbolconst cleanSymbol = str.replace(syminfo.tickerid, "BINANCE:", "")if barstate.islast label.new(bar_index, high, cleanSymbol)Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.