What is the method for converting strings in Java between upper and lower case?
The toLowerCase() method converts a string to lower case letters. Note: The toUpperCase() method converts a string to upper case letters.
The toLowerCase operator takes a string and converts it to all lower case letters. The toUpperCase operator takes a string and converts it to all uppercase letters.
String#toLowerCase and String#toUpperCase are the methods you need.
There are methods in the String class; toUppercase()
and toLowerCase()
.
i.e.
String input = "Cricket!"; String upper = input.toUpperCase(); //stores "CRICKET!" String lower = input.toLowerCase(); //stores "cricket!"
This will clarify your doubt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With