This is the documentation for the development version.
There are no official binaries for it; build it from the source code in git.
Download links on these pages work only after the release.
For the current release, see version 7.0.
replace()
replace(string, old, new): String
Returns the string with all the occurrences of old substring replaced with the new substring. 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 |
String |
The string which will be processed. |
old |
String |
Old substring to be replaced |
new |
String |
The new substring, which would replace the old substring. Can be an empty string. |
Return
Source string with substrings replaced.
println(replace("one four three","four","two")); //Will print "one two three"
println(replace("abc def"," ","")); //Will print "abcdef"