Equana

Docs/Strings/replace
Back to Strings

replace

Replace occurrences of a substring.

Syntax

replace(s, old, new) → String with replacements applied

Backends

TypeScript

Description

Replace occurrences of a substring.

Parameters

NameDescription
sInput string
oldSubstring to find
newReplacement string

Returns

String with replacements applied

Examples

Try It
>> replace("hello world", "world", "earth")
"hello earth"