Differentiate between toLowerCase() and toUpperCase() methods.
Answers
Answered by
1
Explanation:
1. tolowercase() method
This Java string method converts every character of the particular string into the lower case by using the rules of the default locale.
Note: This method is locale sensitive. Therefore it can show unexpected results if used for strings which are intended to be interpreted separately.
Syntax
public String toLowerCase()
Parameters
NA
Return Value
It returns the String, which is converted to lowercase.
Example 1:
public class Guru99 {
public static void main(String args[]) {
String S1 = new String("UPPERCASE CONVERTED TO LOWERCASE");
//Convert to LowerCase
System.out.println(S1.toLowerCase());
}
}
Output:
uppercase converted to lowercase
Similar questions