是“包含”吗? Delphi字符串帮助程序区分大小写吗? [英] Is the "Contains" Delphi string helper case sensitive?

查看:117
本文介绍了是“包含”吗? Delphi字符串帮助程序区分大小写吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delphi XE3引入了 Contains 字符串帮助器功能,但帮助文件/ 维基不声明是否区分大小写吗?

Delphi XE3 introduced a Contains string helper function, but the help-file/wiki does not state whether it is case sensitive or not?

推荐答案

是的,区分大小写。

快速测试:

ShowMessage('TEST'.Contains('t').ToString(TUseBoolStrs.True));

返回错误

使用 ToLowerInvariant 或< a href = http://docwiki.embarcadero.com/Libraries/XE3/en/System.SysUtils.TStringHelper.ToUpperInvariant rel = nofollow> ToUpperInvariant 比较不区分大小写的内容:

Use ToLowerInvariant or ToUpperInvariant to compare case insensitive:

ShowMessage('TEST'.ToLowerInvariant.Contains('t').ToString(TUseBoolStrs.True));

这篇关于是“包含”吗? Delphi字符串帮助程序区分大小写吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆