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();
}

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 ( ) ; }
line - wrap the passed string as an html string with break strings inserted .
