-1
我在UI中获得了输入文本字段。STRING COMPARSION FLASH AS3
当用户键入“GIRAFFEEE”,“GIRAFEAAA”或“GIRAFFE123”并提交时。得分值应为0.但是它返回1.
如何正确比较区分大小写的字符串?
qns1 = qns1_txt.text.toLowerCase();
qns1Ans = "giraffe"
//.toLowerCase();
if (qns1 == qns1Ans)
{
score = 1;
}
else
{
score = 0;
}
请关闭瓶盖。 –
为上限道歉。 – DANLEE
谢谢。现在,请将'trace(qns1)'放在'qns1 = qns1_txt.text.toLowerCase();'string并显示输出之后。 –