Replaces all occurrences matching the target string by the replacement string in the base string.
The replacement proceeds from the beginning of the string to the end, for example, replacing “aa” with “b” in the string “aaa” will result in “ba” rather than “ab”.
String
replaceAll(<parameters>)
Parameter | Type |
---|---|
base | string |
target | string |
replacement | string |
replaceAll(<baseString>,<sourceString>,<replacementString>)
Returns a string.
replaceAll("Hello World", "l", "x")
Returns “Hexxo Worxd”.