Edit: I have modified the question for simplicity.
I have this method to split a long string into an array of strings and it shall return a double string, so that I can write it on a .csv file later:
public class Test {
public static void main(String[] args) throws IOException {
String test = "Michael Porter Jr. 2018-19 Panini Prizm Silver Prizm PSA 10 Gem Mint! Hot! ?? \n 2018 Prizm Silver MICHAEL PORTER JR. RC PSA 10 Gem Mint";
System.out.println(test);
String[] test_split = test.split("\\r?\\n");
for (String t : test_split) {
System.out.println(test_split.toString());
}
}
}
My code returns this:
Michael Porter Jr. 2018-19 Panini Prizm Silver Prizm PSA 10 Gem Mint! Hot! ??
2018 Prizm Silver MICHAEL PORTER JR. RC PSA 10 Gem Mint
[Ljava.lang.String;@4a574795
[Ljava.lang.String;@4a574795
I actually expected to have an arrays with the 2 names (split by the newline character), but I got something weird. How may I fix this please?