Following example shows how to convert a string to upper case.
Sample Program
package com.javatutorialcorner.javastring;
public class ToUpperCase {
public static void main(String[] args) {
String input = "Java tutorials corner contains tutorials for Java programers day to day needs tutorials like Java, Spring, Hibernate, String, JSON, Jackson, GSON, XML parsing, Web Service, SOAP Web Service, RESTful Web Service";
String upperCase = input.toUpperCase();
System.out.println("Input String : " + input);
System.out.println("Upper case String : " + upperCase);
}
}
Output
The above code will produce the following out
Input String : Java tutorials corner contains tutorials for Java programers day to day needs tutorials like Java, Spring, Hibernate, String, JSON, Jackson, GSON, XML parsing, Web Service, SOAP Web Service, RESTful Web Service
Upper case String : JAVA TUTORIALS CORNER CONTAINS TUTORIALS FOR JAVA PROGRAMERS DAY TO DAY NEEDS TUTORIALS LIKE JAVA, SPRING, HIBERNATE, STRING, JSON, JACKSON, GSON, XML PARSING, WEB SERVICE, SOAP WEB SERVICE, RESTFUL WEB SERVICE
0 comments:
Post a Comment