本文整理自网络,侵删。
是否包含:if pos('a','abcdef')>0 thenbegin//包含endeslebegin//不包含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); // Trueend;
相关阅读 >>
Delphi 利用tcomm组件 spcomm 实现串行通信
Delphi �c 如何将多个文件扩展名传递给tdirectory.getfiles?
Delphi windows xp下屏蔽ctrl_alt_del键的方法
Delphi 判断是否为空('none', 'null', '')
更多相关阅读请进入《Delphi》频道 >>