I have this list of array string that I want to write in a file, but in a manner that there will be no space between them and no return to line. So, I tried to use a StringBuilder to that to make it all one unified string. However, I still get some random spaces between.
Here is the code I have:
FileWriter writer = new FileWriter("output.txt");
for (int i =0; i < MainClass.NUM_OF_SPLITS; i++){
StringBuilder sb1 = new StringBuilder();
StringBuilder sb2 = new StringBuilder();
for (String s : MainClass.allSplits.get(i).blocks)
{
sb2.append(s);
}
sb1.append(sb2);
writer.write(sb1.toString());
}
writer.close();
and here is the content of the Output File. The weird caraters are due to the fact that most of my strings are encrypted. Here's the results I get: