本文整理自网络,侵删。
program Project2;
{$APPTYPE CONSOLE}
{$R *.res}
uses System.SysUtils;
function RemoveSlash( Dir: string ): string;begin Result:= Dir; if Dir<>'' then if Result[ length( Result ) ]='\' then Delete( Result, length( Result ), 1 );end;
begin try
Writeln(RemoveSlash('c:\122121\121221\')); readln; { TODO -oUser -cConsole Main : Insert code here } except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end;end.
相关阅读 >>
Delphi xe5 json与Delphi object的互换
Delphi ioutils 获取当前目录下所有的文件/文件夹
Delphi xe 网上获取北京时间android app 启动黑屏优化补丁
更多相关阅读请进入《Delphi》频道 >>