contains
Returns true if the Unicode character corresponding to the specified codePoint belongs to this category.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
val codePoint1 = CodePoint.fromChar('!')
println(codePoint1.category) // OTHER_PUNCTUATION
println("codePoint1 in CharCategory.OTHER_PUNCTUATION is ${codePoint1 in CharCategory.OTHER_PUNCTUATION}") // true
println("codePoint1 !in CharCategory.LOWERCASE_LETTER is ${codePoint1 !in CharCategory.LOWERCASE_LETTER}") // true
val codePoint2 = CodePoint(0x1d7f9) // MATHEMATICAL MONOSPACE DIGIT THREE
println(codePoint2.category) // DECIMAL_DIGIT_NUMBER
//sampleEnd
}Content copied to clipboard
Checks if the specified value belongs to this range.
Since Kotlin
2.5Returns true if this range contains the specified element.
Always returns false if the element is null.