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:
Ilya Gorbunov
2019-11-29 20:11:07 +03:00
parent e30d87ee01
commit 555d503ff9
2 changed files with 9 additions and 6 deletions
@@ -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)