isLetterOrDigit

actual inline fun Char.isLetterOrDigit(): Boolean(source)

Returns true if this character is a letter or digit.

Since Kotlin

1.0

See also

Samples

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

fun main() { 
   //sampleStart 
   val chars = listOf('a', '1', '+')
val (letterOrDigitList, notLetterOrDigitList) = chars.partition { it.isLetterOrDigit() }
println(letterOrDigitList) // [a, 1]
println(notLetterOrDigitList) // [+] 
   //sampleEnd
}

Returns true if this character is a letter or digit.

Since Kotlin

1.3

See also

Samples

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

fun main() { 
   //sampleStart 
   val chars = listOf('a', '1', '+')
val (letterOrDigitList, notLetterOrDigitList) = chars.partition { it.isLetterOrDigit() }
println(letterOrDigitList) // [a, 1]
println(notLetterOrDigitList) // [+] 
   //sampleEnd
}