delphi 文件路径获取文件名不带扩展名


本文整理自网络,侵删。

 
//文件路径获取文件名不带扩展名
Function ExtractFileNameNoExt(FileString: String): String;
Var
  FileWithExtString: String;
  FileExtString: String;
  LenExt: Integer;
  LenNameWithExt: Integer;
Begin
  FileWithExtString := ExtractFileName(FileString);
  LenNameWithExt    := Length(FileWithExtString);  FileExtString     := ExtractFileExt(FileString);   LenExt            := Length(FileExtString);
  If LenExt = 0 Then
     Begin
       Result := FileWithExtString;
     End
     Else
      Begin
       Result := Copy(FileWithExtString,1,(LenNameWithExt-LenExt));
      End;
 End;

相关阅读 >>

Delphi向当前窗口模拟键盘ctrl+v发送"粘贴"

Delphi strtodatetime 这个函数在win7下出错

Delphi twebbrowser:确定带有框架的页面何时完成

Delphi setwindowshookex - 设置钩子 unhookwindowshookex - 卸掉钩子

Delphi中的处理事件 application.processmessages

Delphi 读取流信息

Delphi 使用shellexecuteex运行应用程序并等待完成

Delphi 跨平台的,在fmx中读取icon文件的每一帧到bitmap

Delphi 屏幕渐变效果的源代码

Delphi jpg/jpeg 图片缩放函数

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



打赏

取消

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

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

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

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

评论

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