本文整理自网络,侵删。
{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 d10.x 在android 9及更高版本下使用Delphi获取设备序列号?
更多相关阅读请进入《Delphi》频道 >>