Packagevegas.net
Classpublic class HTMLEntities
InheritanceHTMLEntities Inheritance Object

This static tool class encode or decode the HTML entities in a string.



Public Properties
 PropertyDefined By
  entities : Array
[static] Determinates all entities.
HTMLEntities
  specialchars : Array
[static] Determinates all special chars.
HTMLEntities
Public Methods
 MethodDefined By
  
decode(text:String, removeCRLF:Boolean = false):String
[static] Decodes the specified string.
HTMLEntities
  
encode(text:String):String
[static] Encodes the specified text passed in argument.
HTMLEntities
  
getCharToEntity(char:String):String
[static] Returns the entity name of the specified character in argument.
HTMLEntities
  
getCharToEntityNumber(char:String):String
[static] Returns the entity number string representation of the specified character in argument.
HTMLEntities
  
getEntityNumberToChar(entityNumber:String):String
[static] Returns the char representation of the specified entity number string value in argument or an empty string value.
HTMLEntities
Property Detail
entitiesproperty
public static var entities:Array

Determinates all entities.

specialcharsproperty 
public static var specialchars:Array

Determinates all special chars.

Method Detail
decode()method
public static function decode(text:String, removeCRLF:Boolean = false):String

Decodes the specified string.

Example :

         import vegas.net.HTMLEntities  ;
         trace( HTMLEntities.decode("<b>hello world</b>" ) ) ; // hello world
         

Parameters

text:String
 
removeCRLF:Boolean (default = false)

Returns
String — the decode string.
encode()method 
public static function encode(text:String):String

Encodes the specified text passed in argument.

Example :

         import vegas.net.HTMLEntities  ;
         trace( HTMLEntities.encode("hello world" ) ) ; // <b>hello world</b>
         

Parameters

text:String

Returns
String — a string encode text.
getCharToEntity()method 
public static function getCharToEntity(char:String):String

Returns the entity name of the specified character in argument. Returns an empty string value if the char passed-in argument isn't a special char to transform in entity string representation.

Example :

         import vegas.net.HTMLEntities  ;
         trace( HTMLEntities.getCharToEntity("<") ) ;
         

Parameters

char:String

Returns
String — the entity name of the specified character in argument.
getCharToEntityNumber()method 
public static function getCharToEntityNumber(char:String):String

Returns the entity number string representation of the specified character in argument.

Example :

         import vegas.net.HTMLEntities  ;
         trace( HTMLEntities.getCharToEntityNumber("<") ) ;
         

Parameters

char:String

Returns
String — the entity number string representation of the specified character in argument.
getEntityNumberToChar()method 
public static function getEntityNumberToChar(entityNumber:String):String

Returns the char representation of the specified entity number string value in argument or an empty string value.

Example :

         import vegas.net.HTMLEntities  ;
         trace( HTMLEntities.getEntityNumberToChar("<")) ; // <
         

Parameters

entityNumber:String

Returns
String — the char representation of the specified entity number string value in argument or an empty string value.