本文整理自网络,侵删。
{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 在 api 函数中使用 pchar 参数的几种方法
扩展 Delphi 线程 使之传递参数.(给匿名线程增加参数)
Delphi 掌控pagecontrol中的右上方的左右箭头事件
更多相关阅读请进入《Delphi》频道 >>