question: private String wrap ( String str ) { StringBuilder buf = new StringBuilder ( str ) ; int len = lineLength ; while ( len < buf . length ( ) ) { int idx = buf . lastIndexOf ( " " , len ) ; if ( idx != - 1 ) { buf . replace ( idx , idx + 1 , breaker ) ; len = idx + breaker . length ( ) + lineLength ; } else { buf . insert ( len , breaker ) ; len += breaker . length ( ) + lineLength ; } } buf . insert ( 0 , "<html>" ) ; return buf . toString ( ) ; }
target:  line-wrap the passed String as an html string with break Strings inserted.