本文整理自网络,侵删。
{delphi 截取绝对路径的文件名。}
function ExtractFileName(Str: string): string;
var
i: Integer;
begin
Result := '';
for i := Length(Str) downto 1 do
begin
if Str[i] <> '\' then Insert(Str[i], Result, 0)
else Exit;
end;
end;
相关阅读 >>
如何在Delphi中禁用关于“返回值...可能未定义”的警告?
Delphi研究之驱动开发篇(六)--利用section与用户模式程序通讯(上)
更多相关阅读请进入《Delphi》频道 >>