2021年3月17日星期三

How to pass escaped [aabb] to replaceAll() method in java?

I want to replace a string "[aabb]" in a txt file, but if I wanted to use replaceAll("[aabb]", "x"); method for this replacement, java sees that as a regular expression. How can I escape "[aabb]" string?

https://stackoverflow.com/questions/66681187/how-to-pass-escaped-aabb-to-replaceall-method-in-java March 18, 2021 at 05:03AM

没有评论:

发表评论