|
delphi 判断字符是否是汉字,ByteType字符串中判断是否英文
- //判断字符是否是汉字
- function IsHZ(ch: WideChar): boolean;
- var
- i:integer;
- begin
- i:=or d(ch);
- if( i<19968) or (i>40869) then
- result:=false else result:=true;
- end;
- ByteType字符串中判断是否英文
- ByteType('123你好吗',1)=mbSingleByte//单字节
- ByteType('123你好吗',4)=mbLeadByte//双字节字符的第一个字符
- ByteType('123你好吗',5)=mbTrailByte//双字节字符的第二个字符
-
-
- function IsMBCSChar(const ch: Char): Boolean;
- begin
- Result := (ByteType(ch, 1) <> mbSingleByte);
- end;
- 是否中文(简体,繁体)
复制代码
|
|