1

I need to get the number before ':' from a string using robotframework how can I do it?

${str}=    Set Variable  7939:customer-Id:123a34ghas

I need to get only 7939 before ':' how can I do it in the robot framework?

${Id}=   split string ${str}
log to console   ${Id} #Should give only 7939

1 Answer 1

2
${str}=    Set Variable    7939:customer-Id:123a34ghas

${Id}=    split string    ${str}    :

log to console    ${Id}[0]    #prints 7939
Sign up to request clarification or add additional context in comments.

1 Comment

Please always format code, especially here with RF, it I just copy your example/solution, it won't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.