You could do something like so:
String str = "....";
String parsedStr = str.replaceAll("(.{100})", "$1\n");
This will replace every 100 characters with the same 100 characters and add a new line at the end.
The (.{100})
will capture a group of 100 characters. The $1
in the second will put the content of the group. The \n
will be then appended to the 100 characters which have been just matched.