- Home /
How to convert string to uppercase or lowercase?
Hello,
How to convert string to uppercase or lowercase?
I've tried String.toUpperCase() but it's not supported.
Answer by Larry-Dietz · May 15, 2010 at 03:48 PM
use String.ToUpper()
EDIT: String.ToLower()
for lower case
-Larry
Thanks a lot :) By the way could you tell where to get documentation with this (and hope more :) functions?
This I just know from program$$anonymous$$g in C# and VB.net for so long. So I just tried it real quick in a Javascript in Unity to make sure it would work :)
Is there a way to convert the first letter of a string to an upper case? Like if I have some inputs, and want to convert them to lower case first, so I can check the strings for the command inputs, and if none, just return the first letter to capital?
Answer by Slarti-42 · Oct 14, 2021 at 04:24 PM
String.ToUpper() doesn't work:
textField = textField.ToUpper(); textField = textField.ToLower();
Answer by Junaid-Rehman · Oct 15, 2021 at 02:27 PM
// convert string to uppercase const upperStr = str.toUpperCase(); // convert string to lowercase const lowerStr = str.toLowerCase();,// convert string to uppercase const upperStr = str.toUpperCase();
// convert string to lowercase const lowerStr = str.toLowerCase(); Try This.
Your answer
![](https://koobas.hobune.stream/wayback/20220612235910im_/https://answers.unity.com/themes/thub/images/avi.jpg)