Hello I have an array list that consists of numbers but are strings.
Like this: ["1.1",1.2]. The problem is that I am running into that I am using a for function to split an item of the array list into a string array.
For example if I have array list: ["1.1","1.2"] I would
String[] string_array= array_list.get(0).split("\\.");
That should be working fine, but the problem that I am facing is that it would create a weird string array like [Ljava.lang.String;@ccac396 .
I am not really sure what causes this problem as I used split and array string before and none of this happened.
Note: I am splitting on . ,but since . is a regex I have to use \\. which should split on ..
Here is the part of the code that is causing the problem:
for (int i = 0; i < array_list.size(); i++) {
String[] splitted_on_for_for_reverse;
splitted_on_for_for_reverse = array_list.get(i).split("\\.");
array_list.remove(i);
String string_to_add = splitted_on_for_for_reverse[1].concat(".").concat(splitted_on_for_for_reverse[0]);
array_list.add(string_to_add);
}
I know the problem is not happening from the array list as I have tested it with logs and its fine. the problem is with the string array but I dont know what to do. Any help is appreciated and thanks in advance
[Ljava.lang.String;@ccac396I think you are logging the srray. That is not the way to see it's content. Check it in debugger