tolowercase_Java字符类toLowerCase()方法的示例

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值