W3cubDocs

/Kotlin

isLetterOrDigit

Platform and version requirements: JVM (1.0), Native (1.3)
fun Char.isLetterOrDigit(): Boolean
For JVM

Returns true if this character is a letter or digit.

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

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('a', '1', '+')
val (letterOrDigitList, notLetterOrDigitList) = chars.partition { it.isLetterOrDigit() }
println(letterOrDigitList) // [a, 1]
println(notLetterOrDigitList) // [+]
//sampleEnd
}
For Native

Returns true if this character is a letter or digit.

© 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-or-digit.html