17 lines
No EOL
322 B
Kotlin
17 lines
No EOL
322 B
Kotlin
package net.dankito.fints.extensions
|
|
|
|
|
|
fun String.allIndicesOf(toFind: String): List<Int> {
|
|
val indices = mutableListOf<Int>()
|
|
var index = -1
|
|
|
|
do {
|
|
index = this.indexOf(toFind, index + 1)
|
|
|
|
if (index > -1) {
|
|
indices.add(index)
|
|
}
|
|
} while (index > -1)
|
|
|
|
return indices
|
|
} |