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;

相关阅读 >>

Delphi7 中tstringlist的delimiter delimitedtext有bug,字符串分割有问题

Delphi 字符串转换为16进制整数 整数转换为16进制字符串

Delphi 字节数转换为kb或mb字符串

Delphi html转义

Delphi中如何用image控件显示网络图片

Delphi静态和动态调用dll的实例

Delphi 18位身份证号码的校验

print documents from Delphi - print pdf, doc, xls, html, rtf, docx, txt

Delphi申请和释放内存

Delphi 通过有道接口实现翻译

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



打赏

取消

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

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

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

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

评论

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