Skip to content

Instantly share code, notes, and snippets.

View FindPartners
fun findPartners(key: String, arr: Array<String>): Unit {
var name = key.substring(0, key.lastIndexOf('_'))
val regex = Regex(name + "_[0-9]+")
arr.forEach { s ->
if (regex.containsMatchIn(s)) {
println(s)
}
}
}