3 ms·
> What if your game needs to talk to a server and do some string manipulation in between requests? What conceivable reason would there be to ever need to do th
by lmm 2y ago
> What if your game needs to talk to a server and do some string manipulation in between requests?
What conceivable reason would there be to ever need to do that? If the server takes commands in upper case, then have them in upper case from the start. If the server takes commands in lower case, have them in lower case from the start. If the server specifies that you need to invert the case of its response to use in the next request, find a server developed by someone not crazy.
- fluoridation 2y agoCase conversion is not the only string manipulation that's locale sensitive.
- NBJack 2y agoWord censoring? Ease of use? Console commands (i.e. from Quake to minecraft)?
- wongarsu 2y agoThose sound exactly like the newcomer detectors GP was referring to. What you want is a case-insensitive string comparison, and outside ASCII that's not equivalent to just turning both strings to lowercase and checking equality (or doing a substring search or whatever the task requires)
- account42 2y agoExactly and where you want case-insensitive comparison you almost always also want other kinds of Unicode normalization.
- lmm 2y ago> Word censoring? Should only ever be needed for text from the user, and in that case, as GP said, find a way to examine it as-is, don't "convert". > Ease of use? What ease of use? When has futzing around with case ever made anything easier? > Console commands (i.e. from Quake to minecraft)? Why would those necessitate changing case?