fun CharSequence.findLastAnyOf( strings: Collection<String>, startIndex: Int = lastIndex, ignoreCase: Boolean = false ): Pair<Int, String>?
Finds the last occurrence of any of the specified strings in this char sequence, starting from the specified startIndex and optionally ignoring the case.
startIndex
- The index of character to start searching at. The search proceeds backward toward the beginning of the string.
ignoreCase
- true
to ignore character case when matching a string. By default false
.
Return
A pair of an index of the last occurrence of matched string from strings and the string matched or null
if none of strings are found.
To avoid ambiguous results when strings in strings have characters in common, this method proceeds from the end toward the beginning of this string, and finds at each position the first element in strings that matches this string at that position.
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/find-last-any-of.html