I have a big problem. I have just try to search a solution, but i don't have find any solution. i have this code
public static String getString() throws IOException {
String content = null;
File folder = new File("C:\\Soluzioni.txt");
content = FileUtils.readFileToString(folder) + "\n";
String remainingString = content.substring(content.indexOf("["),
content.lastIndexOf("]") + 1);
System.out.println(remainingString);
return remainingString;
}
And this is ok. (For clarity)
OUTPUT :[40,-13,-6,-7,-4] [28,-40,45,-29,37] [-43,19,-24,-9,-45] [26,-41,-28,-16,44]
My problem is now:
public static String[] arg() throws IOException {
String[] strArray = { getString() };
System.out.println(strArray);
return strArray;
}
when i print strArray, i have an error (ECLIPSE show me this: [Ljava.lang.String;@796686c8). I would need my string (remainingString) to become an array of strings(strArray), but that maintained the same format, that is, it was always
OUTPUT :[40,-13,-6,-7,-4] [28,-40,45,-29,37] [-43,19,-24,-9,-45] [26,-41,-28,-16,44]
but with array format. Thank you very much!