java String

Java String toUpperCase() Code With Examples

Table of Contents

Program


public class StringToUpperCase 
{
	public static void main(String args[]) 
	{
		String Str = new String("Welcome to Girikalan Magic Show");	
		System.out.println(Str.toLowerCase());
                System.out.println(Str.toUpperCase());
	}
}


Output

welcome to girigalan magic show
WELCOME TO GIRIGALAN MAGIC SHOW*/        

Description

public String toLowerCase()

Converts all of the characters in this String to lower case using the rules of the default locale. This is equivalent to calling toLowerCase(Locale.getDefault()).

Note: This method is locale-sensitive, and may produce unexpected results if used for strings that are intended to be interpreted locale independently.

Returns:

the String, converted to lowercase.

public String toUpperCase​

Converts all of the characters in this String to upper case using the rules of the given Locale.

Parameters:

locale – use the case transformation rules for this locale

Returns:

the String, converted to uppercase.

Since:

1.1