本文整理自网络,侵删。
判断字符串是否包含限制以外的字符 否则置空procedure TMainForm.cbSearchExit(Sender: TObject); //判断退出事件varJ:Integer;K:String;begin K := TsEdit(Sender).Text;for J:=1 to Length(K) do beginif not(K[J] in ['0'..'9','a'..'z','A'..'Z']) then beginTsEdit(Sender).Text:='';end;end;end;可以使用下列方法将不符合的字符突出显示出来TsEdit(ctl).SelectAllTsEdit(ctl).SelLengthTsEdit(ctl).SelStartTsEdit(ctl).SelText――――――――――――――――
原文链接:https://blog.csdn.net/u010431493/article/details/79785430
相关阅读 >>
Delphi webbrowser中模拟连接点击(非鼠标模拟)
Delphi xe5 json与Delphi object的互换
Delphi types of actual and formal var parameters must be identical
Delphi sysutils.comparestr、sysutils.comparetext - 字符串比较
Delphi (vcl及fmx[firemonkey])启动时的欢迎窗口实现代码
更多相关阅读请进入《Delphi》频道 >>