Use stringescapeutils. In commons lang3 Alternative to escape javascript()

My task is to convert our code from using org apache. commons. Lang update to org apache. commons. Lang3, I found that the updated version of stringescape utils no longer has the method escape JavaScript (), but we use this in many places in our code

I've been reading the document. It seems that the whole stringescapeutils has been rewritten to lang3 (see release notes Lang 3.3.2). Through this rewriting, they deleted escapejavascript (), but they didn't say anything to be used as an alternative method in any document (not what I can see anyway) This is what's new documentation

So my problem is that I can't be the only one who notices this and encounters this problem, so I use stringescapeutils What is an alternative to escape javascript()?

Solution

Escapecemscript or escapejson is a suitable alternative

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>