replaceFirst
fun CharSequence.replaceFirst(
regex: Regex,
replacement: String
): String
Replaces the first occurrence of the given regular expression regex in this char sequence with specified replacement expression.
Parameters
replacement
- A replacement expression that can include substitutions. See Regex.replaceFirst for details.