我用密码
Result:=
((ch>='0') and (ch<='9')) or
((ch>='a') and (ch<='z')) or
((ch>='A') and (ch<='Z')) or
(ch='_');它检测ok AnsiChar;如何检测WideChar的“是否为字符或数字”?
发布于 2015-03-12 21:25:01
我想解决这个问题没有简单的方法。你对字母的定义是什么?Ω(omega)是字母吗?这只是个符号吗?你必须手动决定什么是字母,什么不是。您可以做一个大小写语句,以确定字符是否为alpha数字.
function is_alpha_num(ch : widechar) : boolean;
begin
case ch of
#$0030..#$0039, // '0'..'9'
#$0041..#$005A, // 'A'..'Z'
#$0061..#$007A, // 'a'..'z'
// need to define the rest here...
#$FF21..#$FF3A // 'A'..'Z'
: result := true;
else result := false;
end;
end;https://stackoverflow.com/questions/28712213
复制相似问题