Difference between Char.IsDigit() and Char.IsNumber() in C#
Char.IsDigit()
is a subset of Char.IsNumber()
.
Some of the characters that are 'numeric' but not digits include 0x00b2 and 0x00b3 which are superscripted 2 and 3 ('²' and '³') and the glyphs that are fractions such as '¼', '½', and '¾'.
Note that there are quite a few characters that IsDigit()
returns true
for that are not in the ASCII range of 0x30 to 0x39, such as these Thai digit characters: '๐' '๑' '๒' '๓' '๔' '๕' '๖' '๗' '๘' '๙'.
This snippet of code tells you which code points differ:
static private void test()
{
for (int i = ; i <= 0xffff; ++i)
{
char c = (char) i; if (Char.IsDigit( c) != Char.IsNumber( c)) {
Console.WriteLine( "Char value {0:x} IsDigit() = {1}, IsNumber() = {2}", i, Char.IsDigit( c), Char.IsNumber( c));
}
}
}
Difference between Char.IsDigit() and Char.IsNumber() in C#的更多相关文章
- 【C#遗补】之Char.IsDigit和Char.IsNumber的区别
原文:[C#遗补]之Char.IsDigit和Char.IsNumber的区别 Char中IsDigit和IsNumber的两个方法都是用来判断字符是否是数字的,那他们有什么区别 IsDigit ...
- Char.IsDigit与Char.IsNumber的区别
需要判断Char是否为数字,查看了下MSDN,发现有三种方法: Char.IsDigit (aChar) 指示指定字符串中位于指定位置处的字符是否属于十进制数字类别 Char ...
- C语言char s[] 和 char *s的差别
C语言char s[] 和 char *s的差别,以下这个回答解说的非常清晰. The difference here is that char *s = "Hello world" ...
- C语言执行时报错“表达式必须是可修改的左值,无法从“const char [3]”转换为“char [120]” ”,原因:字符串不能直接赋值
解决该问题的方法:使用strcpy函数进行字符串拷贝 原型声明:char *strcpy(char* dest, const char *src); 头文件:#include <string ...
- C/C++ char* arr与char arr[]的区别(反汇编解析)
写作日期:2016.08.31 修改日期:2016.09.01 .2016.09.02. 交流qq:992591601 用了几天时间复习了下C语言.对于C语言的字符串操作有些不习惯,于是作为练习,写下 ...
- 【转】深入理解const char*p,char const*p,char *const p,const char **p,char const**p,char *const*p,char**const p
一.可能的组合: (1)const char*p (2)char const*p (3)char *const p(4)const char **p (5)char const**p (6)char ...
- char *p 与char p[] 比较
看看下面的程序的输出: #include <stdio.h>char *returnStr(){ char *p="hello world!"; retur ...
- char str[]和char *str的区别
1.http://blog.csdn.net/szchtx/article/details/10396149 char ss[]="C++"; ss[0]='c'; ...
- char *c和char c[]区别
char *c和char c[]区别 问题引入:在实习过程中发现了一个以前一直默认的错误,同样char *c = "abc"和char c[]="abc",前者 ...
随机推荐
- zw版【转发·台湾nvp系列Delphi例程】HALCON DivImage2
zw版[转发·台湾nvp系列Delphi例程]HALCON DivImage2 procedure TForm1.Button1Click(Sender: TObject);var op : HOpe ...
- yii2验证码的使用
1.控制器中 public function actions() { return [ 'captcha' => [ ...
- msyql数据库位置
MySQL默认的数据文件存储目录为/var/lib/mysql.假如要把目录移到/home/data下需要进行下面几步: 1.home目录下建立data目录 cd /home mkdir data 2 ...
- mysql主从同步及清除信息
主:reset master; 从:reset slave all; mysql主从配置: 1.MySQL主配置文件增加如下:default-storage-engine = innodbinnodb ...
- eclipse项目中启动项目无法载入类
在eclipse 项目中,当载入jar包后,加载里面的包,可以找到此类,但是编译运行的时候报错java.lang.ClassNotFoundException: 1,路径名未写正确: 2,配置出错; ...
- Temporary TempDB Tables [AX 2012]
Temporary TempDB Tables [AX 2012] 1 out of 4 rated this helpful - Rate this topic Updated: November ...
- WKWebView与Js实战(OC版)
前言 上一篇专门讲解了WKWebView相关的所有类.代理的所有API.那么本篇讲些什么呢?当然是实战了! 本篇文章教大家如何使用WKWebView去实现常用的一些API操作.当然,也会有如何与JS交 ...
- 图示-Centos7完整安装
工作过程中,一些未接触过Centos,或未安装过Centos的同事经常会问,如何安装?这个事说简单真简单,只有操作过一次,第二次就能够熟练的自己动手安装:但说难也难,如果没人带,第一次安装的时候确实不 ...
- Oracle之主键的创建、添加、删除操作
一.创建表的同时创建主键约束 1.1.无命名 SQL)); Table created SQL> select table_name,index_name from user_indexes w ...
- Spring和MyBatis环境整合
SSH框架的结合几乎家喻户晓,但是一般的中小项目,使用Spring和MyBatis就够了,而且MyBatis轻便好使,易上手,值得大家尝试一次. 开篇简介: Spring: Spring是一个轻量级的 ...