public static String buildString ( Consumer < StringPrinter > printer ) { StringBuilder builder = new StringBuilder ( ) ; printer . accept ( new StringPrinter ( builder :: append ) ) ; return builder . toString ( ) ; }
Easy way to create a String using a StringPrinter .