Groovy: Replace / in Path with \
10,884
Look at this "//10.1.1.1/temp/test".replaceAll("/","\\\\")
. "\\\\"
makes a single backslash.
Author by
Booyeoo
Updated on June 04, 2022Comments
-
Booyeoo almost 2 years
How would you replace
/
with\
in Groovy? So that"//10.1.1.1/temp/test"
becomes"\\10.1.1.1\temp\test"
."//10.1.1.1/temp/test".replaceAll(/'\\/'/,'\\')
<-- ? doesn't workDoes anyone have an idea?
Thanks for any answer.