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;
是否中文(简体,繁体)

相关阅读 >>

Delphi httpclient async异步获取网页代码

Delphi xe10 百度车牌识别

Delphi idftp连不上ftp服务器的解决方法

crc8unt.pas

Delphi 字符串加密解密单元

Delphi xe 移动平台 showmodal 范例

Delphi 移动windows开始按钮到任务栏中的任何位置

Delphi 简单得多线程应用

Delphi 文件夹重命名

Delphi 截图程序方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...