if (userSolutionText == photoCube.renderer.material.name)
The Materialname (upper lower case letters) is equal to the String (only upper case letters, since I´m using a font with only uppercase letters) the user needs to submit. But for the checking i need to convert the 2 strings both to uppercase letters only.
Is there a function in Unity for that?
What about a function like strtoupper in Javascript, i tried but i think I´m making a mistake somewhere. Could somebody give me a hint or code snippet
userSolutionText.ToLower() will return the lowercase version of userSolutionText. photoCube.renderer.material.name.ToLower() will do the same for the material name. Comparing the results of these function calls should yield the desired result.
Edit: it appears you asked for upper, which obviously would require ToUpper() rather than ToLower()
The ToUpper function did it ! There is now only a slight problem with the string from the material.
As soon as I press the submit button (-> starts the checking of the strings) the Materialname gets an additional “(Instance)” to its name which changes the otherwise equal strings. Ergo string != string 2.
What would be the best approach to get rid of the part “INSTANCE” (upper after conversion) → String2 - (INSTANCE).
As you see the .NET stuff is still new to me so I´m sometimes a little lost there.
expand the shorter string with the instance part and check then. check if the shorter string is contained in the longer string, if the longer starts with the shorter and all alike
same you would do when you had a printed dictionary in front of you actually