Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copying random length part of the string.
#1
Solved: 10 Years, 9 Months, 1 Week ago
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!
Reply


Messages In This Thread
Copying random length part of the string. - by unbeliever - 12-29-2009, 02:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  VB Script - random string qtp_user22 5 26,103 06-19-2014, 04:54 PM
Last Post: roysam404
  How to extract part of a string between two particular characters. ACCBAJPA 7 5,383 08-22-2013, 02:39 PM
Last Post: ACCBAJPA
Exclamation Retrieve the complete height and width of a browser beyond the visible part as wel learnQtptips 0 2,019 05-22-2013, 09:36 AM
Last Post: learnQtptips
  how to get mantissa and decimal part Ishul 3 3,905 03-28-2012, 10:40 PM
Last Post: Surya
  How to have a variable that has a string comma string .. shareq1310 5 4,794 11-09-2011, 03:33 PM
Last Post: parminderdhiman84

Forum Jump:


Users browsing this thread: 1 Guest(s)