Question:
How do you convert a whole string to the lower case values?
Answer:
Using the String toLowerCase() method.
Code:
public class LowerCase { public static void main(String[] args) { String str = "ABCDEF GHIJKL MNOPQR STUVWXYZ"; String low = str.toLowerCase(); System.out.println("Original string: " + str); System.out.println("Lower case: " + low); } }
Output:
$ java LowerCase Original string: ABCDEF GHIJKL MNOPQR STUVWXYZ Lower case: abcdef ghijkl mnopqr stuvwxyz