Remove or replace a backslash with replaceAll regex in Java

Sometimes logical solutions can be unintuitive. If you want to replace a single backslash in Java using replaceAll there are multiple layers of escaping that leads to four backslashes as an argument for replaceAll.

 

1 One person thinks it's helpful 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *