groovy: how to replaceAll ')' with ' '

Posted by user311884 on Stack Overflow See other posts from Stack Overflow or by user311884
Published on 2010-04-11T13:34:43Z Indexed on 2010/04/11 13:43 UTC
Read the original article Hit count: 279

Filed under:
|

i tried this:

def str1="good stuff 1)"
def str2 = str1.replaceAll('\)',' ')

but i got this:

Exception org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script11.groovy: 3: unexpected char: '\' @ line 3, column 29. 1 error at org.codehaus.groovy.control.ErrorCollector(failIfErrors:296)

question: how to do this:

str1.replaceAll(')',' ')

© Stack Overflow or respective owner

Related posts about groovy

Related posts about replaceall