2nd stage of replaceFirst semantics change: remove deprecated String.replaceFirst(String), rename replaceFirstLiteral to replaceFirst.

This commit is contained in:
Ilya Gorbunov
2015-06-24 19:07:26 +03:00
parent 249106647c
commit d20d8e2106
3 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ public fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolea
public fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boolean = false): String =
nativeReplace(RegExp(Regex.escape(oldChar.toString()), if (ignoreCase) "gi" else "g"), newChar.toString())
deprecated("Use replaceFirst(String, String) instead.")
deprecated("Use replaceFirst(String, String) instead.", ReplaceWith("replaceFirst(oldValue, newValue, ignoreCase = ignoreCase)"))
public fun String.replaceFirstLiteral(oldValue: String, newValue: String, ignoreCase: Boolean = false): String =
nativeReplace(RegExp(Regex.escape(oldValue), if (ignoreCase) "i" else ""), Regex.escapeReplacement(newValue))