replaceFirst
fun String.replaceFirst(
oldChar: Char,
newChar: Char,
ignoreCase: Boolean = false
): String
(Common source) (JVM source) (JS source) (Native source)
fun String.replaceFirst(
oldValue: String,
newValue: String,
ignoreCase: Boolean = false
): String
(Common source) (JVM source) (JS source) (Native source)
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.