Advertisement
public String toLowerCase()
//Program to convert a String to lower case letters.
class StringUpper
{
public static void main(String[] ar)
{
String str= new String("HELLO , HOW ARE YOU?");
System.out.println("Original String is : "+ str);
System.out.println("String's lower case value : " + str.toLowerCase());
}
}
String's value : HELLO, HOW ARE YOU?
String's lower case value : hello, how are you?
//Program to convert a String to lower case letters.
class StringUpper
{
public static void main(String[] ar)
{
String str= new String("HURRAY! It's Sunday!");
System.out.println("Original String is : "+ str);
System.out.println("String's lower case value : " + str.toLowerCase());
System.out.println("String value : " + str);
}
}
String's value : HURRAY! It's Sunday!
String's lower case value : hurray! it's sunday!
String's value : HURRAY! It's Sunday!
Advertisement
//Program to convert a string to lower case letters.
class StringUpper2
{
public static void main(String[] ar)
{
String str= new String("CZECH REPUBLIC");
System.out.println("Original string is : "+ str);
str=str.toLowerCase(); //result of calling toLowerCase() is stored back in String object
System.out.println("String's value after converting to lower case : " + str);
}
}
Original string is : CZECH REPUBLIC
String's value after converting to lower case : czech republic
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement