replaceFirst method Null safety
Replaces the first occurrence of
Finds the first occurrence of
pattern in the current range,
then replaces that occurrence with
Then returns a range on the resulting characters
which contains the inserted replacement characters
and any remaining characters of the original range.
The inserted characters may combine with the preceding or following code points, so that the start and end of the original range are no longer grapheme cluster boundaries. In that case, the returned range may extend into into the code points before and after the original range.
null if there are no occurrences of
in the current range.
CharacterRange? replaceFirst(Characters pattern, Characters replacement);