isDigit

Returns true if the Unicode character corresponding to this code point is a digit.

A character is considered to be a digit if its category is CharCategory.DECIMAL_DIGIT_NUMBER.

Since Kotlin

2.5

Samples

import kotlin.text.unicode.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   println("CodePoint.fromChar('0').isDigit() is ${CodePoint.fromChar('0').isDigit()}") // true
println("CodePoint(0x1d7f9).isDigit() is ${CodePoint(0x1d7f9).isDigit()}") // true // MATHEMATICAL MONOSPACE DIGIT THREE
println("CodePoint.fromChar('Ü').isDigit() is ${CodePoint.fromChar('Ü').isDigit()}") // false 
   //sampleEnd
}

Returns true if the Unicode character corresponding to this code point is a digit.

A character is considered to be a digit if its category is CharCategory.DECIMAL_DIGIT_NUMBER.

Since Kotlin

2.5

Samples

import kotlin.text.unicode.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   println("CodePoint.fromChar('0').isDigit() is ${CodePoint.fromChar('0').isDigit()}") // true
println("CodePoint(0x1d7f9).isDigit() is ${CodePoint(0x1d7f9).isDigit()}") // true // MATHEMATICAL MONOSPACE DIGIT THREE
println("CodePoint.fromChar('Ü').isDigit() is ${CodePoint.fromChar('Ü').isDigit()}") // false 
   //sampleEnd
}