title: Java how can I add an accented "e" to a string?
body: <p>With the help of tucuxi from the existing post <a href="https://stackoverflow.com/questions/2488967/java-remove-html-from-string-without-regular-expressions">Java remove HTML from String without regular expressions</a> I have built a method that will parse out any basic HTML tags from a string. Sometimes, however, the original string contains html hexadecimal characters like &amp;#x00E9 (which is an accented e). I have started to add functionality which will translate these escaped characters into real characters.</p>
  
  <p>You're probably asking: Why not use regular expressions? Or a third party library? Unfortunately I cannot, as I am developing on a BlackBerry platform which does not support regular expressions and I have never been able to successfully add a third party library to my project.</p>
  
  <p>So, I have gotten to the point where any &amp;#x00E9 is replaced with "e". My question now is, how do I add an actual 'accented e' to a string? </p>
  
  <p>Here is my code:</p>
  
  <p>public static String removeHTML(String synopsis) {</p>
  
  <pre><code>char[] cs = synopsis.toCharArray();
    String sb = new String();
    boolean tag = false;
    for (int i = 0; i &lt; cs.length; i++) {
     switch (cs[i]) {
     case '&lt;':
      if (!tag) {
       tag = true;
       break;
      }
     case '&gt;':
      if (tag) {
       tag = false;
       break;
      }
     case '&amp;':
  
      char[] copyTo = new char[7];
      System.arraycopy(cs, i, copyTo, 0, 7);
  
      String result = new String(copyTo);
  
      if (result.equals("&amp;#x00E9")) {
       sb += "e";
      }
  
      i += 7;
      break;
     default:
      if (!tag)
       sb += cs[i];
     }
    }
  
    return sb.toString();
   }
  </code></pre>
  
  <p>Thanks!</p>