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",前者 ...
随机推荐
- 【crunch bang】程序中文化
在应用程序中配置使用中文显示. # apt-get install locales # dpkg-reconfigure locales 安装文泉驿-微米黑字体: sudo apt-get insta ...
- 目前主流的国产WebApp框架
1.FrozenUI:QQ 2.WeUI:WeChat 3.SUI:Taobao
- 安装qt5.3.2后,qtcreator在ubuntu 11.04无法启动的问题
在官方网站下载.run文件安装后,qtcreator启动失败,然后找到命令行启动,失败原因如下: shr@shr-Sieyuan:~/Qt5.3.2/Tools/QtCreator/bin$ ./qt ...
- 在Javaweb中使用Scala
Java 是一门比较优秀的编程语言, 其最大功劳是建立非常繁荣的JVM平台生态.不过 Java 语法比较麻烦,写过 C, Python 的人总是想使用简洁的语法,又希望利用上 Java 平台的强大,因 ...
- android listview万能适配器
参考 Android 快速开发系列 打造万能的ListView GridView 适配器 Hongyang public class CommonViewHolder { private Con ...
- PHP过滤评论关键词
<?php /** * PHP中屏蔽过滤指定关键字实现方法总结 * http://www.111cn.net/phper/phpanqn/46225.htm * * 思路: * 一.把关键字专门 ...
- linux crontab定时执行
#利用crontab定时执行url研究了两种简单方式#一利用lynx访问url yum install lynxservice crond startcrontab -einsert键* * * * ...
- Asp.net Vnext ModelBinding
Model Binding 本文已经同步到<Asp.net Vnext 系列教程 >中] Model binding(绑定)简单来说就是通过遍历ValueProvider(值提供者)获取的 ...
- 20145227《Java程序设计》第3次实验报告
20145227<Java程序设计>第3次实验报告 实验步骤与内容 一.实验内容 XP基础 XP核心实践 相关工具 二.实验过程 (一)敏捷开发与XP 1.XP是以开发符合客户需要的软件为 ...
- 什么情况下用+运算符进行字符串连接比调用StringBuffer/StringBuilder对象的append性能好
如果在编写代码的过程中大量使用+进行字符串评价还是会对性能造成比较大的影响,但是使用的个数在1000以下还是可以接受的,大于10000的话,执行时间将可能超过1s,会对性能产生较大影响.如果有大量需要 ...