replace
Modified on Wed, 02 Aug 2023
Description
Replace matches for pattern in a string with replacement.
Syntax
replace(input, find, replacement)
Parameters
Input Parameter | Type | Description |
---|---|---|
input | string | The string to modify. |
find | string | The pattern to replace. |
replacement | string | The match replacement. |
Return value
Type |
---|
string |
Sample
Example | Result | Description |
---|---|---|
replace('Hi Fred', 'Fred', 'Barney') | 'Hi Barney' | Replace 'Fred' with 'Barney' |
replace('Hi Fred Sr and Fred Jr !', 'Fred', 'Barney') | 'Hi Barney Sr and Barney Jr !' | Replace all occurrences of'Fred' with 'Barney' |
To view all the String functions, click here.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article