Sample code for 30+ languages & platforms
Swift

StringBuilder EntityDecode

Demonstrates the Chilkat StringBuilder EntityDecode method to decode HTML entities.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    // Decode the following HTML entities, replacing each with the character represented.
    var s: String? = "é é é Latin small letter e with acute"

    let sb = CkoStringBuilder()!

    sb.append(value: s)
    sb.entityDecode()

    // Output: é é é Latin small letter e with acute
    print("\(sb.getAsString()!)")

}