isLetter

Common
JVM
JS
1.0
fun Char.isLetter(): Boolean
(Common source) (JVM source) (JS source)

Returns true if this character is a letter.

A character is considered to be a letter if its category is CharCategory.UPPERCASE_LETTER, CharCategory.LOWERCASE_LETTER, CharCategory.TITLECASE_LETTER, CharCategory.MODIFIER_LETTER, or CharCategory.OTHER_LETTER.

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

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('a', 'β', '+', '1')
val (letters, notLetters) = chars.partition { it.isLetter() }
println(letters) // [a, β]
println(notLetters) // [+, 1]
//sampleEnd
}