Delphi 检查字符是否汉字
function CheckHZ(ch: WideChar): boolean;
var i: Integer;
begin
i := Ord(ch);
if (i < 19968) or (i > 40869) then
result := False
else
result := True;
end;
调用方法:
CheckHZ(Edit1.text[1]);
或者
txt: string; //定义变量为字符型
CheckHZ(txt[1]);