什么是Unicode letter
起因:从一段代码说起
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace Test
{
class Program
{
static void Main(string[] args)
{
string temp = "1610MM001A衫片";
foreach (Char item in temp)
{
if (char.IsLetter(item))
{
Console.WriteLine(item);
}
}
Console.ReadKey(); }
}
}
这段代码的输出

原本以为是“MMA”,为什么汉子“衫片”也是?
F12,看一下

那么什么是Unicode(参见http://www.cnblogs.com/John-Marnoon/p/5825906.html),
那么,Unicode Letter都包括什么呢?
首先,查一下微软的Char.IsLetter 方法 (String, Int32)
https://msdn.microsoft.com/zh-cn/library/zff1at55(v=vs.110).aspx

其次,看一下IsLetter的源代码

进一步看看CheckLetter方法

大写字母、小写字母、标题字母(首字母大写)、修饰语字母、其他字母。
因为各个国家的语言都不一样,例如有的语言是带声调的。所以仅从个人理解以及涉及到的应用范围,这个unicode letter应该是所有汉字+英文字母,数字和符号大多不包括在内。
但是也有例外。。。。
例如下面就会让你蒙圈了。。。 哈哈哈
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace Test
{
class Program
{
static void Main(string[] args)
{
bool a1 = char.IsLetter('!');
bool a2 = char.IsLetter('ǃ');
bool b1 = char.IsLetter('|');
bool b2 = char.IsLetter('ǀ'); Console.WriteLine(a1);
Console.WriteLine(a2);
Console.WriteLine(b1);
Console.WriteLine(b2);
Console.ReadKey();
}
}
}

如有错误,还请不吝指教。
附录
这五类具体包括什么,请查询 http://www.fileformat.info/info/unicode/category/index.htm

什么是Unicode letter的更多相关文章
- The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Cha
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Cha ...
- [转]Python中的str与unicode处理方法
早上被python的编码搞得抓耳挠腮,在搜资料的时候感觉这篇博文很不错,所以收藏在此. python2.x中处理中文,是一件头疼的事情.网上写这方面的文章,测次不齐,而且都会有点错误,所以在这里打算自 ...
- 中文和unicode互转
public class Test { public static void main(String[] args) { String uname="欧阳红"; for (int ...
- java 中文转换成Unicode编码和Unicode编码转换成中文
转自:一叶飘舟 http://blog.csdn.net/jdsjlzx/article/details/ package lia.meetlucene; import java.io.IOExcep ...
- unicode转码,如:\u6d4b\u8bd5转成中文“测试”
public static void main(String[] args) { String s = "测试"; String tt = gbEncoding(s); // St ...
- 码表 Unicode GBK UTF8 示例
Unicode的编码形式与对应的字符串相互转换 /** * Unicode的编码形式与对应的字符串相互转换 * @author 白乾涛 */ public class UnicodeUtils ...
- #翻译# 深入JavaScript的Unicode难题(上)
退一步说, JavaScript处理Unicode时有些怪异. 这篇文章会说明JS在Unicode上令人痛苦的部分, 然后提供解决方案, 并说明在未来的ECMAScript6中是如何改善这些问题的. ...
- The Most Wanted Letter
The Most Wanted Letter You are given a text, which contains different english letters and punctuatio ...
- Love Hotels and Unicode[转]
原文地址:http://www.reigndesign.com/blog/love-hotels-and-unicode/ 讲得挺通俗的一篇文章 On Sunday 28 October I atte ...
随机推荐
- 使用配置文件来配置JDBC连接数据库
1.管理数据库连接的Class 代码如下: package jdbcTest;import java.sql.Connection;import java.sql.DriverManager;impo ...
- 设置一个顺手的Xcode
授权转载,作者:吴白(微博) 手指在键盘上飞速跳跃,终端上的代码也随着飞舞,是的这确实很酷.优秀的程序员总是这么一群人,他们不拘于现状,不固步自封,他们喜欢新奇的事,他们把自己发挥到极致. 指法攻略 ...
- 软件测试基础homework3
//本次的作业为/******************************************************* * Finds and prints n prime integers ...
- [原创]Oracle 12c 抢先安装手迹
[前言] Oracle 12c 终于投放市场了,唉,等了很久了.据官方说这是一个为云计算平台量身定做的版本....且不管真的假的,先让我们把它装上再说. 注:笔者在安装的过程中发现12c的安装过程,较 ...
- EntityFramework优缺点
高层视图: 改变在现有系统使用EntityFramework的优势是什么? • All -in-1框架的类映射表,需要编写映射代码, 并且是很难维护的. • 可维护性,易于理解的代码,无需创造大的数据 ...
- iOS开发masonry的一些使用简介
从一开始的纯代码计算frame,虽然自认为计算frame 刚刚的,但是到后来还是开始xib的自动约束和手动约束与frame搭配使用,经历这几种方式,大概一年前开始普遍使用masonry来代码约束之后也 ...
- iOS:崩溃统计工具Crashlytics的使用
一.介绍 随着苹果在世界火热起来,移动端app的开发如火如荼,同时催生出了一批对app进行统计的开发工具,诸如:国内的友盟统计.国外的Flurry移动端统计.国外的Crashlytics统计等,Cra ...
- android.graphic.Path
类path是一个封装的几何学路径包括直线,二次曲线,三次曲线.它可以通过函数canvas.drawPath(path, paint)画出来,可以通过填充方式或者画线方式(由paint的style决定) ...
- JQuery DOM clone(true),对于克隆对象事件触发后,处理函数中this指代克隆对象
<!doctype html> <html ng-app> <head> <script src="./jquery.js">< ...
- String转json
一.下载json 具体到http://www.json.org/上找Java-json下载,并把其放到项目源代码中,这样就可以引用其类对象了 转载地址:http://blog.csdn.net/tax ...