Java String toLowerCase() Method
Chapter:
String Handling
Last Updated:
04-09-2017 14:43:30 UTC
Program:
/* ............... START ............... */
public class JavaStringToLowerCase {
public static void main(String args[]) {
String Str = new String("Welcome to JAVAScan.com");
System.out.println(Str.toLowerCase());
}
}
/* ............... END ............... */
Output
Notes:
-
In the above program using the String function toLowerCase() program converts String "Welcome to JAVAScan.com" to welcome to javascan.com.
- toLowerCase() Method converts all of the characters in the String to lower case.
- String toLowerCase(Locale locale): It converts the string into Lowercase using the rules defined by specified Locale.
- String toLowerCase() is equivalent to toLowerCase(Locale.getDefault()).
- Locale.getDefault() gets the current value of the default locale for this instance of the Java Virtual Machine. The Java Virtual Machine sets the default locale during startup based on the host environment.
Tags
toLowerCase() Method, String, Java