57
votes

I have some string like

C:\dev\deploy_test.log

I want by means of Groovy to convert string to

C:/dev/deploy_test.log

I try to perform it with command

Change_1 = Log_file_1.replaceAll('\','/');

It doesn't convert this string

1

1 Answers

109
votes

You need to escape the backslash \:

println yourString.replace("\\", "/")