groovy: how to replaceAll ')' with ' '
You have to escape the \
inside the replaceAll
def str2 = str1.replaceAll('\\)',' ')
Same as in Java:
def str2 = str1.replaceAll('\\)',' ')
You have to escape the backslash (with another backslash).
A more Groovy way: def str2 = str1.replaceAll(/\)/,' ')