KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there a recommended way to escape < , > , " and & characters when outputting HTML in plain Java code? (Other than manually doing the following, that is). String source = "The less than sign (<) and ampersand (&) must be escaped before using them in HTML"; String escaped = source.replace("<", "<").replace("&", "&"); // ...
Tags (comma-separated)
Save Edits
Cancel