判断输入是否为汉字的方法
2011-12-21 11:34
351 查看
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace 判断是否为汉字 { class Program { static void Main(string[] args) { Console.WriteLine("请输入:"); IsChina(Console.ReadLine()); Console.ReadLine(); } public static bool IsChina(string CString) { bool BoolValue=false; for (int i=0; i<CString.Length; i++) { if(Convert.ToInt32(Convert.ToChar(CString.Substring(i,1)))<Convert.ToInt32(Convert.ToChar(128))) { BoolValue = false; Console.WriteLine("非汉字"); } else { BoolValue = true; Console.WriteLine("汉字"); } } return BoolValue; } } }
相关文章推荐
- php判断输入是否是纯数字,英文,汉字的方法
- php判断输入是否是纯数字,英文,汉字的方法
- JS判断输入的字符串是否是数字的方法(正则表达式)
- c# 输入字符为汉字的判断方法
- js判断是否输入的为数字的方法
- C#判断输入是否为汉字
- 判断输入的是否为汉字或者数字
- java中判断是否为汉字的小方法
- Java把字符串中的数字删除的方法和判断字符串里面是否有汉字的方法
- 判断输入的是否是汉字(中文,不包括中文符号)
- java判断输入的字符串是否为数字的方法
- js判断字符是否存在汉字的方法
- ios--uitextfield动态限制输入的字数(解决方案) 汉字和英文状态区别 判断当前输入法是否是中文
- C#三种判断字符是否为汉字的方法
- js判断是否输入的为数字的方法
- iOS开发笔记-判断输入的是否是汉字
- 类库------对一些字符串进行操作的类1.判断输入是否数字2.截取字符串函数3.过滤输入信息4.生成随机数5.生成验证码图片6.获取汉字第一个拼音7.半角转全角8.全角转半角
- c++判断输入的整型变量是否合法的方法
- java判断字符串中是否有中文或者汉字的方法
- 检测input每次的输入是否合法遇到汉字输入就有问题,如何判断汉字是否已经输入到input内???