Sample code for 30+ languages & platforms
PureBasic

StringBuilder EntityDecode

Demonstrates the Chilkat StringBuilder EntityDecode method to decode HTML entities.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkStringBuilder.pb"

Procedure ChilkatExample()

    ; Decode the following HTML entities, replacing each with the character represented.
    s.s = "é é é Latin small letter e with acute"

    sb.i = CkStringBuilder::ckCreate()
    If sb.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkStringBuilder::ckAppend(sb,s)
    CkStringBuilder::ckEntityDecode(sb)

    ; Output: é é é Latin small letter e with acute
    Debug CkStringBuilder::ckGetAsString(sb)


    CkStringBuilder::ckDispose(sb)


    ProcedureReturn
EndProcedure