首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

差异输入的字符是英文的还是中文 或者是 特殊字符

2013-04-02 
区别输入的字符是英文的还是中文 或者是 特殊字符区别中文和英文字符的方法:Pattern p Pattern.compile(

区别输入的字符是英文的还是中文 或者是 特殊字符

区别中文和英文字符的方法:

Pattern p = Pattern.compile("[&%$#@!(),*^]"); //可在此加上其他的特殊字符    Matcher m = p.matcher(str);    if (m.find()) {    Toast.makeText(getApplicationContext(),"you can not enter special Character", 1).show();    } else {    Toast.makeText(getApplicationContext(),"input ok", 1).show();}


热点排行