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

Returns a copy where the first 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".replaceFirst("a", "x") == "x-b-a"