Converting a char to uppercase

前端 未结 10 725
南方客
南方客 2020-12-02 09:48
String lower = Name.toLowerCase();
int a = Name.indexOf(\" \",0);
String first = lower.substring(0, a);
String last = lower.substring(a+1);
char f = first.charAt(0);         


        
10条回答
  •  一个人的身影
    2020-12-02 10:14

    The easiest solution for your case - change the first line, let it do just the opposite thing:

    String lower = Name.toUpperCase ();
    

    Of course, it's worth to change its name too.

提交回复
热议问题