getReplaceFirst

fun getReplaceFirst(input: String?, regex: String?, replacement: String?): String?

Replace the first subsequence of the input sequence that matches the regex with the given replacement string.

Return

the string constructed by replacing the first matching subsequence by the replacement string, substituting captured subsequences as needed

Parameters

input

The input.

regex

The regex.

replacement

The replacement string.