klyn.regex.RegEx.replace
method
public native replace(input as String, replacement as String) as String:
DescriptionReplaces all occurrences of the pattern with a replacement string.
regex = RegEx(r"\d+")
result = regex.replace("123 abc 456", "#") # result will be "# abc #"
ReturnsThe string after the replacement. ``` regex = RegEx(r"\d+") result = regex.replace("123 abc 456", "#") # result will be "# abc #" ```