delphi 文件路径结尾去掉“\”


本文整理自网络,侵删。

 
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 辨析 field、fielddef、fields、fielddefs、fieldlist、fielddeflist

Delphi下对dbf文件进行物理删除

Delphi exe注入代码

Delphi 排列桌面图标

Delphi 校验文件大小

Delphi 利用51.la统计程序使用量

Delphi spcomm 调试串口解决总是在程序断开的时候才发送指令的问题

Delphi 拷贝dbgrid当前行

Delphi xe5读取android imei id

Delphi readprocessmemory 输入进程id 输入读取地址

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



打赏

取消

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

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

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

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

评论

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