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

Replaces the first 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".replaceFirst('a', "xy") == "xyba"