groovy or java: how can replace '\' with '\\' 'C:\www\web-app\StudyReports\test.bat'

Posted by john on Stack Overflow See other posts from Stack Overflow or by john
Published on 2010-06-02T18:29:16Z Indexed on 2010/06/02 18:34 UTC
Read the original article Hit count: 167

Filed under:
|
|

hi,

this might be trivial (please forgive me for that)

but my eventual goal is to have a string like

def newline= 'C:\\www\web-app\StudyReports\\test.bat'

but my old line only have one '\',

i tried different ways of using the following

def newline=oldline.replaceAll(/\\/,'//')

but did not work at ...

could someone help me out.

© Stack Overflow or respective owner

Related posts about java

Related posts about regex