java String

Convert UpperCase to LowerCase

Table of Contents

Program

public class ToCase 
{
	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 toUpperCase()

Converts all of the characters in this String to upper case using the rules of the default locale. This method is equivalent to toUpperCase(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. Examples are programming language identifiers, protocol keys, and HTML tags. For instance, “title”.toUpperCase() in a Turkish locale returns “T\u0130TLE”, where ‘\u0130’ is the LATIN CAPITAL LETTER I WITH DOT ABOVE character. To obtain correct results for locale insensitive strings, use toUpperCase(Locale.ENGLISH).

Returns:

the String, converted to uppercase.

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. Examples are programming language identifiers, protocol keys, and HTML tags. For instance, “TITLE”.toLowerCase() in a Turkish locale returns “t\u0131tle”, where ‘\u0131’ is the LATIN SMALL LETTER DOTLESS I character. To obtain correct results for locale insensitive strings, use toLowerCase(Locale.ENGLISH).

Returns:

the String, converted to lowercase.