isDigit

JVM
Native
1.0
fun Char.isDigit(): Boolean
For JVM

Returns true if this character (Unicode code point) is a digit.

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

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

Returns true if this character (Unicode code point) is a digit.