isLetterOrDigit
Returns true
if this character is a letter or digit.
Since Kotlin
1.5See 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.5See 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.0See 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.3See 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
}