And i have no idea why!
I bascially have a STRING (yes, not an array), that has the following contents:
[something, something else, somoething, trall
You are getting a valid array of String
s, but trying to print it directly does not do what you would expect it to do. Try e.g.
System.out.println(Arrays.asList(urlArr));
If you want to process the parsed tokens one by one, you can simply iterate through the array, e.g.
for (String url : urlArr) {
// Do something with the URL, e.g. print it separately
System.out.println("Found URL " + url);
}
When you do toString
on an Array, you just get the internal representation. Not that useful. Try Arrays.toString(what comes back from split)
for something more readable.
The output
[Ljava.lang.String;@186d4c1
is the way java prints a string array (or any array) by default (when converted to a string). You may use
Arrays.toString(urlArr)
to get a more readable version.