I have a string variable similar to
String my = "split it";
I split this using split().
java.util.Arrays.toString(my.split("\\s+"))
The output is [split it]. But I want to store this in an arraylist, in FIRST index split and in SECOND index. Pls let me know how will I can achieve this.Thanks in advance.
1 Answer