我需要使用robotframework从字符串中获取':'之前的数字,怎么办?
${str}= Set Variable 7939:customer-Id:123a34ghas
我只需要在<:>之前得到 7939 ,如何在机器人框架中实现?
${Id}= split string ${str}
log to console ${Id} #Should give only 7939
答案 0 :(得分:2)
${str}= Set Variable 7939:customer-Id:123a34ghas
${Id}= split string ${str} :
log to console ${Id}[0] #prints 7939