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