diff --git a/libraries/stdlib/src/kotlin/text/Strings.kt b/libraries/stdlib/src/kotlin/text/Strings.kt index d473a52143a..e82b9002dcd 100644 --- a/libraries/stdlib/src/kotlin/text/Strings.kt +++ b/libraries/stdlib/src/kotlin/text/Strings.kt @@ -1013,7 +1013,7 @@ public fun CharSequence.indexOf(string: String, startIndex: Int = 0, ignoreCase: * * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string. * @param ignoreCase `true` to ignore character case when matching a character. By default `false`. - * @return An index of the first occurrence of [char] or -1 if none is found. + * @return An index of the last occurrence of [char] or -1 if none is found. */ public fun CharSequence.lastIndexOf(char: Char, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int { return if (ignoreCase || this !is String) @@ -1028,7 +1028,7 @@ public fun CharSequence.lastIndexOf(char: Char, startIndex: Int = lastIndex, ign * * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string. * @param ignoreCase `true` to ignore character case when matching a string. By default `false`. - * @return An index of the first occurrence of [string] or -1 if none is found. + * @return An index of the last occurrence of [string] or -1 if none is found. */ public fun CharSequence.lastIndexOf(string: String, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int { return if (ignoreCase || this !is String)