delphi ValidateName 过滤特殊字符


本文整理自网络,侵删。

 
function ValidateName(n: string): string;
var banned, res: string; i,j: integer;
begin
  res:= n;
  banned:= '\/:*?"<>|';
  for i:= 1 to Length(res) do
    for j:= 1 to Length(banned) do
      if res[i]=banned[j] then res[i]:=' ';
  Result:= res;
end;

相关阅读 >>

Delphi listview1 中添加check选中事件

Delphi 取最前窗口标题(不重复)

Delphi socket connect timeout 套字节链接超时设置

Delphi 校验文件大小

Delphi 提取字符串中所有数字

Delphi 格式化输出函数(2): formatdatetime

Delphi 捕捉异常 try except语句 和 try finally语句用法以及区别

如何在Delphi中禁用关于“返回值...可能未定义”的警告?

Delphi tms web core webhttprequest1 解析json

Delphi xe3中如何crc验证函数?

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



打赏

取消

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

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

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

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

评论

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