klyn.String.replaceLast
method
public native replaceLast(oldValue as String, newValue as String) as String
Description

Returns a copy where the last occurrence of oldValue is replaced by newValue.

Parameters
  • oldValue Value to replace.
  • newValue Replacement value.
Returns

A new string with the replacement applied.

Example
assert "a-b-a".replaceLast("a", "x") == "a-b-x"