Make String first letter capital in java

后端 未结 8 2161
耶瑟儿~
耶瑟儿~ 2020-12-29 04:04

As of now I\'m using this code to make my first letter in a string capital

String output = input.substring(0, 1).toUpperCase() + input.substring(1);
<         


        
8条回答
  •  鱼传尺愫
    2020-12-29 04:42

    class strDemo3
    {
        public static void main(String args[])
        {
            String s1=new String(" the ghost of the arabean sea");
            char c1[]=new char[30];       
            int c2[]=new int[30];
            s1.getChars(0,28,c1,0);
            for(int i=0;i

提交回复
热议问题