Tag: 判断预览模式: 普通 | 列表
09-09
18

判斷輸入的字串中,中英文判別

要判斷中文得先知道中文 unicode 的 range,
希望下面例子對你有幫助

public class Test{
public static void main(String[] args) {
String test = "Is This 123 中文 or 不是";
System.out.print("char\t");
System.out.print("unicode\t");
System.out.println("hex\t");

查看更多...

Tags: 英文 中文 判断

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 240
09-09
16

Java 判断输入是否为英文字符

代码如下:

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package onlinedictionarytest.cn.edu.ynu.sei.test;

/**

查看更多...

Tags: 英文 判断

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 797