<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv=Content-Type content=text/html; charset=gb2312 />
<title>jsp判斷字符串是否為漢字</title>
</head>
<body>
<%
String str = jsp判斷字符串是否為漢字;
char c = str.charAt(0);
if(c>=0x4e00 && c<=0x9fa5){
out.print(有漢字!);
}else{
out.print(沒有漢字!);
}
%>
</body>
</html>
更多關(guān)于云服務(wù)器,域名注冊,虛擬主機(jī)的問題,請訪問西部數(shù)碼官網(wǎng):www.ps-sw.cn