Is there a native Mathematica way to convert a string like ""
into "<select></select>"
and similarly for other reserved characters in html (or another encoding that would work in a webpage)?.
I'm working in webMathematica, but I can't find a good way to print the literal string ""
into a page - it either gets converted into an node, or it gets wrapped in a tag.
Answer
The different HTML entities are stored in System`Convert`MLStringDataDump`$HTMLEntities
on version 9 and from here, it's a simple StringReplace
:
StringReplace["", System`Convert`MLStringDataDump`$HTMLEntities]
(* "<select></select>" *)
Comments
Post a Comment