public static String buildStringFromLines(String... lines){
  int numChars=lines.length;
  for (  String line : lines) {
    numChars+=line.length();
  }
  StringBuilder builder=new StringBuilder(numChars);
  for (  String line : lines) {
    builder.append(line);
    builder.append('\n');
  }
  return builder.toString();
}

public static String buildStringFromLines ( String ... lines ) { int numChars = lines . length ; for ( String line : lines ) { numChars += line . length ( ) ; } StringBuilder builder = new StringBuilder ( numChars ) ; for ( String line : lines ) { builder . append ( line ) ; builder . append ( '\n' ) ; } return builder . toString ( ) ; }
easy way to create a string from a bunch of lines .
