Replacing escaped quotes in groovy
1 answer
The first argument to the method is a regular expression, so the backslash character matters and must be escaped. You can use the forward slash line separator to avoid double escaping. replaceAll
assert (/Hello, \"Joe\"/.replaceAll(/\\"/, '"') == 'Hello, "Joe"')
+3
source to share