i think this is a bit faster than % 100 and repeatedly appending
function(String input) {
// array represantation of the String
final char[] inputArray = input.toCharArray();
// same length + amount of newlines (i.e. length / 100)
final char[] outputArray = new char[inputArray.length + (inputArray.length/100)];
int i = 0;
int o = 0;
while(i < inputArray.length) {
// copy every 100th substring
System.arraycopy(inputArray,i,outputArray,o,100);
i += 100;
o += 101;
outputArray[o] = '\n';
}
// copy rest
if(i < inputArray.length) {
System.arraycopy(inputArray,i,outputArray,o,inputArray.length-i);
}
return(outputArray.toString());
}
though untested