public class Test {
public static boolean isHaveWorld(String str){
return str.length() == str.getBytes().length ? false : true;
}
public static void main(String[] args) {
String a1 = "AAA";
String a2 = "AAA您好";
System.out.println(a1 +"==========是否包含汉字========"+isHaveWorld(a1));
System.out.println(a2 +"==========是否包含汉字========"+isHaveWorld(a2));
}
public static boolean isHaveWorld(String str){
return str.length() == str.getBytes().length ? false : true;
}
public static void main(String[] args) {
String a1 = "AAA";
String a2 = "AAA您好";
System.out.println(a1 +"==========是否包含汉字========"+isHaveWorld(a1));
System.out.println(a2 +"==========是否包含汉字========"+isHaveWorld(a2));
}
}