java - after splitting a string, what is the first element in the array?

后端 未结 4 1475
执笔经年
执笔经年 2021-01-11 16:30

I was trying to split a string into an array of single letters. Here\'s what I did,

String str = \"abcddadfad\"; 
System.out.println(str.length());    //  ou         


        
4条回答
  •  盖世英雄少女心
    2021-01-11 17:22

    You can just use the built in java method from the string class. myString.toCharArray() the empty string is being stored at index 0

提交回复
热议问题