Static Public Methods | |
string | entityReferences (const string &s) |
string | trim (const string &s) |
remove the trailing spaces from string s if there are some. | |
vector< string > | splitString (const string &s, char c) |
split a string by unescaped char. | |
string | escapeChar (const string &s, char c) |
escape all char c in string s. |
|
entityReferences converts the special characters in a string to their entity references so that the string can be a legal HTML or XML string. Certain characters, such as the left bracket (<), ampersand (&), etc. are reserved by HTML, SGML and XML to represent special attributes such as the start of HTML elements, graphic characters, and so on. HTML allows special referencing to represent these special characters. These are indicated by either character references or entity references. Entity references use symbolic names to represent the characters. Entity references have three parts: 1. a leading ampersand character, (&), 2. the name of the entity (in ascii characters) 3. a terminating semicolon (;).Thus the entity reference for less than symbol (<) is <.
|
![]() |