isJavaIdentifierPart

JVM
1.0
fun Char.isJavaIdentifierPart(): Boolean
(source)

Returns true if this character (Unicode code point) may be part of a Java identifier as other than the first character.

import java.util.*
import kotlin.test.*

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('a', '_', '1', 'β', '$', '+', ';')
val (javaIdentifierParts, notJavaIdentifierParts) = chars.partition { it.isJavaIdentifierPart() }
println(javaIdentifierParts) // [a, _, 1, β, $]
println(notJavaIdentifierParts) // [+, ;]
//sampleEnd
}