Java String toLowerCase(Locale locale) Example
String class toLowerCase(Locale locale)method example
String class toLowerCase(Locale locale) method example. This example shows you how to use toLowerCase(Locale locale)method.This method Converts all of the characters in this String to lower case using the rules of the given Locale.
Here is the code:-
/**
* @(#) LowerCasestring1.java
*Program that Converts all of the characters in this String to lower case using the rules of the given Locale.
* @Version 01-May-2008
* @author Rose India Team
*/
//for importing the class Locale
import java.util.Locale;
public class LowerCasestring1
{
public static void main(String[] args)
{
String str = "Welcome to RoseIndia";
// Convert the above string to all lowercase using the default system Locale.
Locale loc = Locale.getDefault();
String s1 = str.toLowerCase(loc);
// Display the two strings
System.out.println("old = " + str);
System.out.println("lowercase = " + s1);
}
} |
null
|