为什么'123'是数字的? [英] Why is '१२३' numeric?

查看:238
本文介绍了为什么'123'是数字的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据文档字符串'123'是数字。

According to the documentation the String '१२३' is numeric.

由于我认为这可能是文档中的错误,我运行测试来验证该语句。我发现根据Apache Commons它是数字。

Since I believed this might be a mistake in the documentation, I ran tests to verify the statement. I found that according to Apache Commons it is numeric.

为什么这个字符串数字?这些字符代表什么?

Why is this String numeric? What are those characters representing?

推荐答案

因为CharSequence只包含Unicode数字(引用你的链接文档)。

Because that "CharSequence contains only Unicode digits" (quoting your linked documentation).

对于 Character.isDigit


包含数字的某些Unicode字符范围:

Some Unicode character ranges that contain digits:


  • '\ u0030'到'\ u0039',ISO-LATIN-1位数('0'到'9')

  • '\ u0660'到'\ u0669',阿拉伯语 - 印度数字

  • '\ u06F0'到'\ u06F9',扩展阿拉伯语 - 印度数字

  • '\ u0966'到'\ u096F',梵文数字

  • '\ uFF10'到'\ uFF19',全长数字

  • '\u0030' through '\u0039', ISO-LATIN-1 digits ('0' through '9')
  • '\u0660' through '\u0669', Arabic-Indic digits
  • '\u06F0' through '\u06F9', Extended Arabic-Indic digits
  • '\u0966' through '\u096F', Devanagari digits
  • '\uFF10' through '\uFF19', Fullwidth digits

许多其他字符范围也包含数字。

Many other character ranges contain digits as well.

123 是梵文数字:

  • is DEVANAGARI DIGIT ONE, \u0967
  • is DEVANAGARI DIGIT TWO, \u0968
  • is DEVANAGARI DIGIT THREE, \u0969

这篇关于为什么'123'是数字的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆