isLetter

expect fun Char.isLetter(): Boolean(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.

Since Kotlin

1.5

Samples

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

fun main() { 
   //sampleStart 
   val chars = listOf('a', 'β', '+', '1')
val (letters, notLetters) = chars.partition { it.isLetter() }
println(letters) // [a, β]
println(notLetters) // [+, 1] 
   //sampleEnd
}
actual fun Char.isLetter(): Boolean(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.

Since Kotlin

1.5

Samples

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

fun main() { 
   //sampleStart 
   val chars = listOf('a', 'β', '+', '1')
val (letters, notLetters) = chars.partition { it.isLetter() }
println(letters) // [a, β]
println(notLetters) // [+, 1] 
   //sampleEnd
}
actual inline fun Char.isLetter(): Boolean(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.

Since Kotlin

1.0

Samples

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

fun main() { 
   //sampleStart 
   val chars = listOf('a', 'β', '+', '1')
val (letters, notLetters) = chars.partition { it.isLetter() }
println(letters) // [a, β]
println(notLetters) // [+, 1] 
   //sampleEnd
}
actual fun Char.isLetter(): Boolean(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.

Since Kotlin

1.3

Samples

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

fun main() { 
   //sampleStart 
   val chars = listOf('a', 'β', '+', '1')
val (letters, notLetters) = chars.partition { it.isLetter() }
println(letters) // [a, β]
println(notLetters) // [+, 1] 
   //sampleEnd
}
actual fun Char.isLetter(): Boolean(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.

Since Kotlin

1.8

Samples

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

fun main() { 
   //sampleStart 
   val chars = listOf('a', 'β', '+', '1')
val (letters, notLetters) = chars.partition { it.isLetter() }
println(letters) // [a, β]
println(notLetters) // [+, 1] 
   //sampleEnd
}
actual fun Char.isLetter(): Boolean(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.

Since Kotlin

1.8

Samples

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

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