当前位置:网站首页>Common Unicode encoding range
Common Unicode encoding range
2022-07-24 10:11:00 【Deciduous ex】
common Unicode Coding range
We often use it to judge whether a character or string contains Chinese , english , Special symbols, etc . At this time, we can judge Unicode To determine the type of a character . Of course, it can be judged directly Unicode code , But in view of habits , What is provided below is Unicode The number interval corresponding to the code . After all, the essence of characters is to store and encode through binary .
- Chinese characters :[0x4e00,0x9fa5]( Or decimal [19968,40869])
- Numbers :[0x30,0x39]( Or decimal [48, 57])
- Lowercase letters :[0x61,0x7a]( Or decimal [97, 122])
- Capital :[0x41,0x5a]( Or decimal [65, 90])
- other : Except all
for example :
/** * Whether it contains Chinese characters */
fun String.isContainChinese(): Boolean {
this.forEach {
val c = it.toInt()
if (c in 19968..40868) {
return true
}
}
return false
}边栏推荐
- How does SRE and development of Google cooperate
- What is the cloud native mid platform business architecture?
- When the hot tea is out of stock, what does the new tea drink rely on to continue its life?
- 2022, will lead the implementation of operation and maintenance priority strategy
- Color recognition of regions of interest in pictures and videos based on OpenCV
- Hucang integrated e-commerce project (I): introduction to the project background and structure
- Dynamic programming -- a collection of stock problems
- [leecode] get the longest common substring of two strings
- Openstack network neutron knowledge point "openstack"
- CAS principle [concurrent programming]
猜你喜欢

The concept and representation of a tree

Where is the bitbucket clone address
![[STM32 learning] (7) use of serial port 2 (usart2)](/img/e8/7a01cb2753f448d745e0d8712b3ebc.png)
[STM32 learning] (7) use of serial port 2 (usart2)
![[STM32 learning] (11) STM32 Mifare_ Use of one (S50) m1s50 (read, write, key modification, control bit interpretation)](/img/fd/4290525914b5146fe0eb653517fef9.png)
[STM32 learning] (11) STM32 Mifare_ Use of one (S50) m1s50 (read, write, key modification, control bit interpretation)

2022 trusted cloud authoritative assessment released: Tianyi cloud has obtained ten certifications and five best practices

Dr. water 3
![[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus](/img/8f/19b0eb959d2b3f896c8e99f8e673d1.png)
[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus
![[STM32 learning] (22) STM32 realizes 360 degree rotary encoder](/img/8e/fb036296ec3aff5e60acee5018943c.png)
[STM32 learning] (22) STM32 realizes 360 degree rotary encoder
![CAS principle [concurrent programming]](/img/f0/77e7e1079f70198c601b0f1e25106e.png)
CAS principle [concurrent programming]

Detailed explanation of uninstalling MySQL completely under Linux
随机推荐
Raspberry Pie: /bin/sh: 1: bison: not found
Arduino drive lcd1602a
2022 trusted cloud authoritative assessment released: Tianyi cloud has obtained ten certifications and five best practices
Home raiding II (leetcode-213)
Arduino serial port information reading and output
MySQL status view qps/tps/ cache hit rate view
note: expected ‘void * (***)(void ***)’ but argument is of type ‘void (*)(void *)’
JS bind simulation
CRC Coding in C language
Tree array-
How does ribbon get the default zoneawareloadbalancer?
What's the difference between testing / developing programmers' professionalism and salted fish? They don't want to be excellent coders?
JS string method
The best time to buy and sell stocks Ⅳ (leetcode-188)
Friends come to interview a unicorn company in Beijing at leisure. The interview question is priced at 25K
[C language] implementation of three versions of address book small project (including source code)
二叉树、二叉树排序树的实现及遍历
[leecode] get the longest common substring of two strings
The best time to buy and sell stocks (leetcode-121)
Scala learning: why emphasize immutable objects?