Delphi 字符串是否包含


本文整理自网络,侵删。

 
是否包含:
if pos('a','abcdef')>0 then
begin
//包含
end
esle
begin
//不包含
end;

//--------------------------------------------------------------------------------
var
  str: string;
  b: Boolean;
begin
  str := 'Delphi XE4';

  b := str.Contains('XE'); // True
  b := str.Contains('xe'); // False

  b := str.StartsWith('delphi');       // False
  b := str.StartsWith('delphi', True); // True

  b := str.EndsWith('XE4');            // True

  b := str.EndsText('xe4', str);       // True
end;

相关阅读 >>

Delphi链接自己的主页和邮件

Delphi 利用tcomm组件 spcomm 实现串行通信

Delphi 获取任意月份总共有多少天数

Delphi �c 如何将多个文件扩展名传递给tdirectory.getfiles?

Delphi windows xp下屏蔽ctrl_alt_del键的方法

Delphi system.netencoding

Delphi 数组定义

Delphi 判断是否为空('none', 'null', '')

Delphi 检测是否包含字符

Delphi 在内存中直接运行exe类型的资源文件

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



打赏

取消

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

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

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

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

评论

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