Java escape HTML - string replace slow?

后端 未结 8 592
长情又很酷
长情又很酷 2021-01-22 17:34

I have a Java application that makes heavy use of a large file, to read, process and give through to SolrEmbeddedServer (http://lucene.apache.org/solr/).

One of the func

8条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-22 18:03

    Your approach with multiple replace methods could be slow.

    Look at Apache Commons Lang's StringEscapeUtils for a speedy implementation of escaping HTML entities.

提交回复
热议问题