Advertisements
Advertisements
Question
Describe the purpose of the following function with its syntax:
toLowerCase()
Code Writing
Solution
This function converts the letters to lowercase and then returns them. All capital letters and special characters stay the same.
Example 1:
String s2 = "WALTZ";
s2 = s2.toLowerCase(); System.out.println(s2);
Output: waltz
Example2:
char ch = 'H';
System.out.println(Character.toLowerCase(ch));
Output: h
shaalaa.com
Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 289]