Simple/Direct/Heredoc way of constructing a HTML string in Java

后端 未结 5 1728
忘了有多久
忘了有多久 2020-12-15 04:52

In python I can construct a HTML string without worrying about escaping special characters like < or \" by simply enclosing the string in triple quotes like:



        
5条回答
  •  再見小時候
    2020-12-15 05:26

    It can't be done in Java like in Python. However if you are using Eclipse go to Window->Preferences->Java->Editor->Typing The last check box is "Escape text when pasting into a String literal". Check that. Now when you paste when your cursor is between quotation marks it'll be escaped.

提交回复
热议问题