isLetter
Returns true if the Unicode character corresponding to this code point 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.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
println("CodePoint.fromChar('Ü').isLetter() is ${CodePoint.fromChar('Ü').isLetter()}") // true
println("CodePoint(0x1d7f9).isLetter() is ${CodePoint(0x1d7f9).isLetter()}") // false // MATHEMATICAL MONOSPACE DIGIT THREE
println("CodePoint.fromChar('!').isLetter() is ${CodePoint.fromChar('!').isLetter()}") // false
//sampleEnd
}Content copied to clipboard
Returns true if the Unicode character corresponding to this code point 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.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
println("CodePoint.fromChar('Ü').isLetter() is ${CodePoint.fromChar('Ü').isLetter()}") // true
println("CodePoint(0x1d7f9).isLetter() is ${CodePoint(0x1d7f9).isLetter()}") // false // MATHEMATICAL MONOSPACE DIGIT THREE
println("CodePoint.fromChar('!').isLetter() is ${CodePoint.fromChar('!').isLetter()}") // false
//sampleEnd
}Content copied to clipboard