I want to append a and b string arrays to arrayList. But "1.0" have to be "1" using with split. Split method returns String[] so arrayList add method does not work like this.
Can you suggest any other way to doing this ?
String[] a = {"1.0", "2", "3"};
String[] b = {"2.3", "1.0","1"};
ArrayList<String> arrayList = new ArrayList<String>();
arrayList.add(a[0].split("."));
a[0].split(".")[0]split()is a regular expression, so if you want your delimiter to be., you have to escape it such that it becomes\\...is splitted using\\.in java, refer to answers