isJavaIdentifierStart

JVM
1.0
fun Char.isJavaIdentifierStart(): Boolean

Returns true if this character is permissible as the first character in a Java identifier.

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

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