Improve indexOf sample to showcase return value handling
Remove sample reference from indexOf(Char) overload: both overloads are on the same page, and showing the sample for indexOf(String) under indexOf(Char) is redundant and misleading.
This commit is contained in:
@@ -984,7 +984,6 @@ public fun CharSequence.lastIndexOfAny(strings: Collection<String>, startIndex:
|
||||
*
|
||||
* @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.
|
||||
* @sample samples.text.Strings.indexOf
|
||||
*/
|
||||
public fun CharSequence.indexOf(char: Char, startIndex: Int = 0, ignoreCase: Boolean = false): Int {
|
||||
return if (ignoreCase || this !is String)
|
||||
|
||||
Reference in New Issue
Block a user