Beanshell remove first 0

Beanshell remove first 0

1.Beanshell脚本:

vars.put("currentday","09");

int num;

num=Integer.valueOf(09);

return num;

报错:

Response code: 500

Response message: org.apache.jorphan.util.JMeterException:Error invoking bsh method: eval

2.修正:

int num;

curr=vars.get("currentday");

num=Integer.parseInt(curr);

//num=Integer.valueOf(curr);

return num;

或者vars.put("currentday",String.valueOf(num));

Beanshell remove first 0_第1张图片

你可能感兴趣的:(Beanshell remove first 0)