Wednesday, 18 February 2015

How To Change Case Of String In Java

Some time we need to change input string into uppercase or into lower case fortunately java provides the simple way to do it  below code illustrate how to convert string into lower or upper case.

CODING:

class change
{
public static void main(String args[])
{
String s ="Pro Java Tuorial";
System.out.println("Original String:"+s);
String upper = s.toUpperCase();
String lower = s.toLowerCase();
System.out.println("In Upper Case:"+upper);
System.out.println("In Lower Case:"+lower);
}
}

OUTPUT:


No comments:

Post a Comment