1/* to find the lowercase or uppercase of a string,
2* we just .toLowerCase() or .toUpperCase()
3*/
4
5public class CaseDemonstration {
6 public static void main(String[] args) {
7
8 String testString = "THIS IS AN EXAMPLE OF A STRING";
9 String testStringLower = testString.toLowerCase(); // make a string lowercase
10 System.out.println(testStringLower); // "this is an example of a string"
11 String testStringUpper = testStringLower.toUpperCase(); // make it upper again
12 System.out.println(testStringUpper); // "THIS IS AN EXAMPLE OF A STRING"
13
14 }
15}
1String s1 = "JAVATPOINT HELLO stRIng";
2String s1lower = s1.toLowerCase(); // s1lower = "javatpoint hello string"
1String var_name = "Spider";
2System.out.println(var_name.toLowerCase()); //spider