I am using Anypoint Studio 6.1 and Mule 3.8.1 and want to replace \n with new line and then remove \r, \t, \ from the payload text.
I can do this like:
#[payload.replace('\\n', System.getProperty('line.separator')).replace('\\r', "").replace('\\t', "").replace('\\', "")]
Is there a way to use OR or something similar for the checks on \r, \t, \ to reduce the code?
Thanks
You can make it a little bit shorter by using
replaceAll
and a regex like this: