toLowerCase(char) method?

前端 未结 8 1518
醉酒成梦
醉酒成梦 2021-02-14 17:19

Apparently there is a method that takes a char and returns a char: http://download.oracle.com/javase/6/docs/api/java/lang/Character.html#toLowerCase(char)

But I can\'t s

8条回答
  •  难免孤独
    2021-02-14 17:25

    Use your own implementation to convert character to lower case:

    c = (char) (c ^ 0x20);
    

    In your method:

    public static void main(String[] args) {
            char c = 'A';
            c = (char) (c ^ 0x20);
            System.out.println(c);
           }
    

提交回复
热议问题