[英]How to read html on java without jsoup or any other third party?
我的 class 中有一個 StringBuilder object,我想在 UI 上顯示它。 This object has few html tags for ex: <li> <br>
etc. I would like to know how to format this object so that the html tags are not shown as it is on screen, however they are converted to a readable format.
注意:我不想刪除這些標簽並獲得純文本。 相反,如果有一個<br>
標簽,它應該在顯示文本時換行。 另外,由於項目限制,我不想使用任何第三方,如 jsoup 等。
任何幫助實現這一目標將不勝感激!
帶有特定替換的簡單.toString().replaceAll
怎么樣? 喜歡:
<br>
= \r\n
<li>
= \r\n •
...等等..
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.