如何去掉文件的扩展名
//移除文件扩展名
//此函数将返回没有扩展名的文件名,如果输入的文件名没有扩展,则返回原文件名。
Function DelFileExt(Fn:String):String;
var s,o: byte;
Begin
o:=1;
for s:= Length(Fn) Downto 1 do
If Fn[s]='.' Then begin o:=s; Break; end;
if o >1 then Delete(Fn,s,255);
Result:=Fn;
End
原创文章如转载,请注明:转载自心动吧DELPHI网络书 [ http://www.abcxd.com/delphi/ ]
本文链接地址:http://www.abcxd.com/delphi/abcxddelphi/delphiDIRAA/230.html