Why does c and C taken to be same?

When it was mentioned in the lecture 50 to check whether the Input is same as the HiddenWord or not.

What I faced is:
I set HiddenWord as "Cake"

And when I played the game. And when I typed Cake it says you win. But when I wrote cake i.e, cake with small letter c, still it says you win.

I would like to know that since ASCII values of both c and C are different then why is it still showing the You win in both the cases?

Thanks

It shouldn’t unless you’re using ToLower on that.

This also appears to be the case for me, and I am not using the ToLower function anywhere in my code. Did you ever discover an answer to why “cake” == “Cake” here?

Well I’ll be

/**
	 * Lexicographically test whether the left string is == the right string
	 *
	 * @param Lhs String to compare against.
	 * @param Rhs String to compare against.
	 * @return true if the left string is lexicographically == the right string, otherwise false
	 * @note case insensitive
	 */

How strange to be insensitive :confused:, doesn’t help that this doesn’t seem to be in the docs.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms