+ 4
How can I make the user's inputed string starts with capital letter ??
I want to know how to change the first letter of the inputed string to capital and making all the charracters capital . Thanks for your help :)
1 Odpowiedź
+ 15
To capitalize the first letter of a string you could use (inStr is the string the user input).
String str = inStr.substring(0, 1).toUpperCase() + inStr.substring(1);
To capitalize the whole string use:
String str = inStr.toUpperCase();