1

Given String "Showing 1 to 10 of 3,311 entries". I need to get the 3,311 separately form that string. I can use this ${Number} = Get Substring ${countString} 19 24 but here problem is index was changed.

1
  • 2
    Have a look at regexp. Commented Sep 10, 2020 at 9:32

1 Answer 1

3

You can use the Split String keyword and separate the each part of string by ${SPACE}
Additionaly I removed , from the number just in case you need it. Slightly different way to achieve same - https://stackoverflow.com/a/57786634/5400362

*** Variable ***
${string1}=        Showing 1 to 10 of 3,311 entries

*** Testcases ***
Get Number From String

@{list_string}=     split string    ${string1}      ${SPACE}
log             ${list_string}[5]
${num}=         evaluate       '${list_string}[5]'.replace(',','')

output

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

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.