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_关于null,nil

Delphi [函数] unicode 检查字符串是否含中文字

Delphi udp文件传输

Delphi getrandompassword 生成随机密码

Delphi vcl 模式下和firemonkey 模式下的字符串

Delphi xe6 android 查看电池信息

Delphi 2009 泛型容器单元(generics.collections)[1]: tlist<t>

Delphi winapi: getfocus - 获取当前拥有焦点的窗口的句柄

Delphi中messagebox用法

Delphi hide

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



打赏

取消

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

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

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

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

评论

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