Delphi 根据文件路径获取文件名


本文整理自网络,侵删。

 

 

function GetMovieName(const fn: string): string;

var

  i:Integer;

  s:string;

begin

  s := trim(fn);

  if s[Length(s)]='\' then

    s := Copy(s,1,Length(s)-1);

 

  while Pos('\',s)>0 do

  begin

    i := Pos('\',s);

    s := Copy(s,i+1,Length(s)-i);

  end;

  Result := s;

end;

相关阅读 >>

Delphi版本号检测判断

Delphi从dbgrid导出数据保存成excel文件

Delphi替换字符串中的单引号

Delphi ado组件动态连接access数据库

Delphi 数据库获取所有用户名

Delphi字符串反转函数

Delphi二分查找算法(预排序数组的查找)

Delphi 根据进程名称获取进程号

Delphi 调出windows 系统时间设置对话框

Delphi edgebrowser1 浏览器实现控制滚动条

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



打赏

取消

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

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

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

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

评论

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