http://stackoverflow.com/questions/228532/difference-between-char-isdigit-and-char-isnumber-in-c-sharp

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#的更多相关文章

  1. 【C#遗补】之Char.IsDigit和Char.IsNumber的区别

    原文:[C#遗补]之Char.IsDigit和Char.IsNumber的区别 Char中IsDigit和IsNumber的两个方法都是用来判断字符是否是数字的,那他们有什么区别 IsDigit    ...

  2. Char.IsDigit与Char.IsNumber的区别

    需要判断Char是否为数字,查看了下MSDN,发现有三种方法: Char.IsDigit (aChar)              指示指定字符串中位于指定位置处的字符是否属于十进制数字类别 Char ...

  3. C语言char s[] 和 char *s的差别

    C语言char s[] 和 char *s的差别,以下这个回答解说的非常清晰. The difference here is that char *s = "Hello world" ...

  4. C语言执行时报错“表达式必须是可修改的左值,无法从“const char [3]”转换为“char [120]” ”,原因:字符串不能直接赋值

    解决该问题的方法:使用strcpy函数进行字符串拷贝   原型声明:char *strcpy(char* dest, const char *src); 头文件:#include <string ...

  5. C/C++ char* arr与char arr[]的区别(反汇编解析)

    写作日期:2016.08.31 修改日期:2016.09.01 .2016.09.02. 交流qq:992591601 用了几天时间复习了下C语言.对于C语言的字符串操作有些不习惯,于是作为练习,写下 ...

  6. 【转】深入理解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 ...

  7. char *p 与char p[] 比较

    看看下面的程序的输出: #include <stdio.h>char *returnStr(){    char *p="hello world!";    retur ...

  8. char str[]和char *str的区别

    1.http://blog.csdn.net/szchtx/article/details/10396149 char ss[]="C++";  ss[0]='c';        ...

  9. char *c和char c[]区别

    char *c和char c[]区别 问题引入:在实习过程中发现了一个以前一直默认的错误,同样char *c = "abc"和char c[]="abc",前者 ...

随机推荐

  1. zw版【转发·台湾nvp系列Delphi例程】HALCON DivImage2

    zw版[转发·台湾nvp系列Delphi例程]HALCON DivImage2 procedure TForm1.Button1Click(Sender: TObject);var op : HOpe ...

  2. 【crunch bang】中文美化

    原文连接:http://edyfox.codecarver.org/html/debian_testing_chinese.html 中文字体美化是个很讨厌的事情,无数初学者在这里面浪费了无数时间,做 ...

  3. YII2 Activedataprovider 类分页的使用

    下面以管理员列表为例说明Activedataprovider分页的具体使用 1.控制器中 public function actionIndex(){ $model=new Admin(); $dat ...

  4. ASP.NET MVC的TempData(转载)

    本文章基于ASP.NET MVC Preview5. ASP.NET MVC的TempData用于传输一些临时的数据,例如在各个控制器Action间传递临时的数据或者给View传递一些临时的数据,相信 ...

  5. android 学习随笔四(数据库存储)

    SQLite数据库(sqliteexpert工具),sqlite数据库是轻量级数据库,对数据类型要求不是很严格,在数据库中处理是按verchar类型处理,一般定义表字段时还是要求严格按照数据类型定义, ...

  6. JS和CSS的多浏览器兼容(2)

    2.Css的浏览器兼容性 方法一,根据不同的浏览器加载不同的css file <!DOCTYPE html>  <html> <head> <title> ...

  7. jquery plugins

    jQuery官网插件 jQuery自定义滚动条样式插件 jQuery custom content scroller examples Twitter typeahead typeahead.js t ...

  8. 【jqGrid for ASP.NET MVC Documentation】.学习笔记.7.搜索过滤数据

    1 基础 搜索和过滤功能,是使用确定的条件,查找匹配行数据.jqGrid提供几种搜索模式: Search Dialog 单搜索选项 Search Dialog 多搜索选项 ToolBar Search ...

  9. 关于ADO.NET@SQL Server&SqlDataReader

    先说基础的,说基础的明白了再深的也是一样的.SQL是关系型数据库,所以就决定了对其操作的时候ADO的一些类要相互联系,Connection 类Command对象(ExecuteReader()方法.E ...

  10. symfony中twig的模板载入

    模板 载入模板 {% include ‘sidebar.html’ %} 当前模板的变量也会传递到 被include的模板里,在那里面可以直接访问你这个模板的变量. {% for comment in ...