From e83ceb9d40b22b3b804ae44e4225f13a4d7fc23b Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Mon, 19 Apr 2021 18:32:25 +0300 Subject: [PATCH] [K/N] Fix String.replace doc --- kotlin-native/runtime/src/main/kotlin/kotlin/text/Strings.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/text/Strings.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/text/Strings.kt index aff73e9163a..310e062dc73 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/text/Strings.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/text/Strings.kt @@ -51,6 +51,8 @@ public actual fun String?.equals(other: String?, ignoreCase: Boolean): Boolean { /** * Returns a new string with all occurrences of [oldChar] replaced with [newChar]. + * + * @sample samples.text.Strings.replace */ public actual fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boolean): String { return if (!ignoreCase) @@ -81,6 +83,8 @@ private fun String.replaceIgnoreCase(oldChar: Char, newChar: Char): String { /** * Returns a new string obtained by replacing all occurrences of the [oldValue] substring in this string * with the specified [newValue] string. + * + * @sample samples.text.Strings.replace */ public actual fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolean): String = splitToSequence(oldValue, ignoreCase = ignoreCase).joinToString(separator = newValue)