开发者

delphi remove . and .. from path

开发者 https://www.devze.com 2022-12-27 08:32 出处:网络
How can I remove the . and .. from a path in Delphi (not using .NET). I need a function开发者_开发百科, so I can pass it something like \'c:\\program files..\\program files...\', and I want the functi

How can I remove the . and .. from a path in Delphi (not using .NET). I need a function开发者_开发百科, so I can pass it something like 'c:\program files..\program files...', and I want the function to return to me 'c:\'.

Can Delphi do that on its own? Or do I need to do it myself?


Maybe this is what you are looking for:

SysUtils.ExpandFileName('c:\temp\.\test\..\test2')

It returns the absolute path with all relative parts removed.

0

精彩评论

暂无评论...
验证码 换一张
取 消