fun Char.isLetter(): Boolean
Returns true
if this character is a letter.
import kotlin.test.*
import java.util.*
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
}
Returns true
if this character is a letter.
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/is-letter.html