Sample code for 30+ languages & platforms
Java

StringBuilder EntityDecode

Demonstrates the Chilkat StringBuilder EntityDecode method to decode HTML entities.

Chilkat Java Downloads

Java
import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    //  Decode the following HTML entities, replacing each with the character represented.
    String s = "é é é Latin small letter e with acute";

    CkStringBuilder sb = new CkStringBuilder();

    sb.Append(s);
    sb.EntityDecode();

    //  Output: é é é Latin small letter e with acute
    System.out.println(sb.getAsString());
  }
}