test / indexOf

indexOf

fun Foo.indexOf(    char: Char,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int

Returns the index within this string of the first occurrence of the specified character, starting from the specified startIndex.

Parameters

ignoreCase - true to ignore character case when matching a character. By default false.

Returns An index of the first occurrence of char or -1 if none is found.