code: public String escape(String str) {
          StringBuilder sb = createStringBuilder(str);
          escape(sb, str);
          return sb.toString();
      }
docs: <p>
  Escapes the characters in a <code>String</code>.
  </p>
  
  <p>
  For example, if you have called addEntity(&quot;foo&quot;, 0xA1), escape(&quot;\u00A1&quot;) will return
  &quot;&amp;foo;&quot;
  </p>
  
  @param str
  The <code>String</code> to escape.
  @return A new escaped <code>String</code>.