To check if the first character is number or string:
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
//Body
def body = message.getBody(java.lang.String);
def firstChar = body.substring(0..1)
if (firstChar.matches("[0-9]+")){
number= "true"
}else
{
number = "false"
}
message.setProperty("number",number)
return message;
}
No comments:
Post a Comment