Delphi AnsiEndsText 用法之一(路径结尾自动加\)


本文整理自网络,侵删。

 
引用单元:System.StrUtils

首部 function AnsiEndsText(const ASubText, AText: string): Boolean; $[StrUtils.pas
功能 返回字符串AText是否以子串ASubText结尾
说明 不区分大小写
参考 function Windows.CompareString
例子 CheckBox1.Checked := AnsiEndsText(Edit1.Text, Edit2.Text);


var
Str:string;
begin
Str:='c:';

if AnsiEndsText('\', Str) then
      Edit1.Text := Str
    else
      Edit1.Text := Str + '\';
  end;

演示图:



相关阅读 >>

Delphi 之 tmemo组件使用

Delphi 常见的各种形式的组件的安装方法介绍

Delphi 四舍五入含小数点函数

Delphi 如何将整数值转换为罗马数字表示形式

Delphi把一个字符串中的某个子串,用另一个子串去替换

Delphi try except与try finally不同之处

Delphi 对txt文件的操作

firemonkey listbox 的几个事件:拖动,点击,长按

Delphi 注释方法

Delphi的datetostr strtodate格式灵活用法

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



打赏

取消

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

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

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

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

评论

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