function tt(){
if(document.all.wenben.value!='chs'){
{alert("请输入汉字");
document.all.wenben.focus();
document.all.wenben.value="";}
这个对吗??
为什么我输入是汉字的时候他也说错啊
if(document.all.wenben.value!='chs'){
{alert("请输入汉字");
document.all.wenben.focus();
document.all.wenben.value="";}
这个对吗??
为什么我输入是汉字的时候他也说错啊
import java.io.*;
public class IsIncludeCH{
static BufferedReader keyboard=new BufferedReader(new InputStreamReader(System.in));
public static void main (String args[])throws IOException{
String sent;
int num;
System.out.print("please input a String:");
System.out.flush();
sent=keyboard.readLine();
java.util.regex.Pattern p=java.util.regex.Pattern.compile("[\u4e00-\u9fa5]");
java.util.regex.Matcher m=p.matcher(sent);
if(m.find())
{
System.out.println("含有中文");
}else
{
System.out.println("没有中文");
}
}
}
function checkChs(str)
{
var reg=/^[\u4e00-\u9fa5](\s*[\u4e00-\u9fa5])*$/;
return reg.test(str);
}