I'm trying to replace a string in jenkins pipeline using groovy script the string is
input : prakash/annam/devops
expected output : prakash/\annam/\devops
I'm using this sed -i 's#/#/\#g' . Unfortunately it is working in shell scripting but not in jenkins pipeline. Please give me a solution.