escapeXML()function
escapeXML(value: string): string
| Param | Type | |
|---|---|---|
value | string | The raw string value. required |
| Return | |
|---|---|
string | The escaped XML-safe string. |
Escape a string for safe inclusion in XML text content or attribute values.
- Replaces
&,<,>,", and'with their XML entity equivalents.
Examples
escapeXML(`Tom & "Jerry"`) // "Tom & "Jerry""