tolowercase
人物类toLowerCase()方法 (Character class toLowerCase() method)
toLowerCase() method is available in java.lang package.
toLowerCase()方法在java.lang包中可用。
toLowerCase() method is used to return the lowercase character of the given char value.
toLowerCase()方法用于返回给定char值的小写字符。
toLowerCase() method does not throw an exception at the time of representing uppercase character to lowercase character or lowercase to the lowercase character.
在将大写字符表示为小写字符或将小写字符表示为小写字符时, toLowerCase()方法不会引发异常。
Syntax:
句法:
public char toLowerCase (Char value);
Parameter(s):
参数:
Char value – represents the char value to be converted.
字符值 –表示要转换的字符值。
Return value:
返回值:
The return type of this method is char, it returns the lowercase conversion of the given char value.
此方法的返回类型为char ,它返回给定char值的小写转换。
Example:
例:
// Java program to demonstrate the example
// of char toLowerCase (Char value) method of Character class
public class ToLowerCaseOfCharacterClass {
public static void main(String[] args) {
// It returns p because the passing character will
// be converted in LowerCase by using toLowerCase()
char result1 = Character.toLowerCase('P');
// It returns p because the passing character is
// already in LowerCase
char result2 = Character.toLowerCase('p');
// Display values of result1 , result2
System.out.println("Character.toLowerCase('P'): " + result1);
System.out.println("Character.toLowerCase('p'): " + result2);
}
}
Output
输出量
Character.toLowerCase('P'): p
Character.toLowerCase('p'): p
翻译自: https://www.includehelp.com/java/character-class-tolowercase-method-with-example.aspx
tolowercase