How can I escape this HTML string within Java

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I am having trouble with adding the buttonClassvariable into the class attribute. How can I escape the double and single quotes here?

 String buttonClass= changed ? "changeButton" : "dontChangeButton";
 button.append("<input id= " + id + "  type= button  value= " + buttonValue + "  class= " + buttonClass
 + "  ui-button ui-widget  />");

Answers

http://www.freeformatter.com/java-dotnet-escape.html http://www.freeformatter.com/java-dotnet-escape.html

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/26240668/how-can-i-escape-this-html-string-within-java

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils