delphi 删除文件名中的非法字符

//uses  ioutils
function GetValidName(s:string):string;
var
  c:char;
  txt:string;
begin
  txt:=s;
  for c in TPath.GetInvalidFileNameChars() do
  begin
    txt:=stringreplace(txt,c,'',[rfReplaceAll]);
  end;
  result:=txt;
end;

你可能感兴趣的:(delphi)