首页
微信
安卓
接口
移动
前端
专题
文档库
工具
网址
§
ITPOW
>>
文档
>>
C#
C# 用一句话判断中文
作者:vkvi 来源:ITPOW
(原创)
日期:2010-4-14
byte[] arr = System.Text.Encoding.GetEncoding("gb2312").GetBytes("中");
if (arr.Length == 2)
{
// 中文
}
// 简化成一句
if (System.Text.Encoding.GetEncoding("gb2312").GetBytes("中").Length == 2)
GetBytes 的参数是一个长度的字符串。
相关文章
创建于2005年
渝ICP备05010272号-1
电邮:
cftea@126.com
即将跳转...