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

Replaces the last occurrence of a Unicode scalar with text.

Parameters
ParameterDescription
oldValueScalar to replace.
newValueReplacement text, which may be empty.
Returns

A new String; the receiver is unchanged.

Example

assert "aba".replaceLast('a', "xy") == "abxy"