Is the “Contains” Delphi string helper case sensitive?
问题 Delphi XE3 introduced a Contains string helper function, but the help-file/wiki does not state whether it is case sensitive or not? 回答1: Yes it is case sensitive. Quick test: ShowMessage('TEST'.Contains('t').ToString(TUseBoolStrs.True)); returns False Use ToLowerInvariant or ToUpperInvariant to compare case insensitive: ShowMessage('TEST'.ToLowerInvariant.Contains('t').ToString(TUseBoolStrs.True)); 来源: https://stackoverflow.com/questions/30180634/is-the-contains-delphi-string-helper-case