开发者

Why doesn't SameText work?

Why does

if SameText(Lis开发者_Go百科tBox1.Items[i],Edit1.Text)=true then

not work? It is case-sensitive (strings have different cases), but must be not. The strings are unicode. It works if the strings have the same cases.

Thanks!


According to SysUtils.pas (Delphi-XE), SameText "has the same 8-bit limitations as CompareText", and in CompareText "the compare operation is based on the 8-bit ordinal value of each character, after converting 'a'..'z' to 'A'..'Z', and is not affected by the current user locale."

So it seems that you are trying to compare some characters that are outside the 8 bit range.

Edit: you should try AnsiSameText.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜