Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre>Avery® Laser &amp;amp; Inkjet Self-Adhesive</pre> <p>First use <a href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#unescapeHtml4(java.lang.String)" rel="nofollow noreferrer"><code>StringEscapeUtils#unescapeHtml4()</code></a> (or <a href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#unescapeXml(java.lang.String)" rel="nofollow noreferrer"><code>#unescapeXml()</code></a>, depending on the original format) to unescape the <code>&amp;amp;</code> into a <code>&amp;</code>. Then use <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replaceAll%28java.lang.String,%20java.lang.String%29" rel="nofollow noreferrer"><code>String#replaceAll()</code></a> with <code>[^\x20-\x7e]</code> to get rid of characters which aren't inside the <a href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters" rel="nofollow noreferrer">printable ASCII range</a>.</p> <p>Summarized:</p> <pre><code>String clean = StringEscapeUtils.unescapeHtml4(dirty).replaceAll("[^\\x20-\\x7e]", ""); </code></pre> <p>..which produces</p> <pre>Avery Laser & Inkjet Self-Adhesive</pre> <p>(without the trailing dot as in your example, but that wasn't present in the original ;) )</p> <p>That said, this however look like more a request to <em>workaround</em> than a request to <em>solution</em>. If you elaborate more about the functional requirement and/or where this string did originate, we may be able to provide the <em>right</em> solution. The <code>®</code> namely look like to be caused by using the wrong encoding to read the string in and the <code>&amp;amp;</code> look like to be caused by using a textbased parser to read the string in instead of a fullfledged HTML parser.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload