12-29-2009, 02:12 PM
Dear All,
I have following outertext for WebElement:
"Change page: < 1 2 3 4 5 6 7 8 9 10 ... > | Displaying page 1 of 426, items 1 to 10 of 4257."
What I need to do is to grab 4257 out of this string and assign it to a variable. The trickiest part is that number 4257 can be different: it can consist of different amount of digits, for example this value can be 25, 2454 or 10983. So I cannot just assume that it is four digits.
I have a solution in mind:
- pick part of the string "items 1 to 10 of "
- calculate amount of subsequent digits after it
- grab sequence of these digits (value) and assign it to the variable.
Can you please advise me how to code it with examples?
Thanks in advance!
I have following outertext for WebElement:
"Change page: < 1 2 3 4 5 6 7 8 9 10 ... > | Displaying page 1 of 426, items 1 to 10 of 4257."
What I need to do is to grab 4257 out of this string and assign it to a variable. The trickiest part is that number 4257 can be different: it can consist of different amount of digits, for example this value can be 25, 2454 or 10983. So I cannot just assume that it is four digits.
I have a solution in mind:
- pick part of the string "items 1 to 10 of "
- calculate amount of subsequent digits after it
- grab sequence of these digits (value) and assign it to the variable.
Can you please advise me how to code it with examples?
Thanks in advance!