on 06-15-2022 4:59 PM
Hi Team,
Can anyone help me with a groovy script to replace / with _
Input: HD2781/01
OutPut: HD2781_01
Regards,
Mastan
Hi
You can use as - replaces back slash..
<yourStringVariable>.replace("\\", "_")
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mastan,
import com.sap.gateway.ip.core.customdev.util.Message
def Message processData(Message message) {
def input = message.getBody(String).replaceAll('/','_')
message.setBody(input)
return message
}
Regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can directly use standard function to replace within MM.
https://answers.sap.com/questions/10530180/explain-replacestring-functions.html
User | Count |
---|---|
83 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.