Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to save the dynamic string into variables?
#1
Hi All,

I got a value of dynamic text in the variable, the text is "The value of sum is 88 77 88" now the problem is that its a dynamic text and the numeric values could be more or less. I want to save the numeric values into variable. how can I do it ? any suggestions
my code is

Code:
str=Browser("Logib").Page("EGFR").WebElement("No normal interval ").GetROProperty("text")


This str variable is saving ""The value of sum is 88 77 88""
Reply
#2
Assuming that the string "The value of sum is" is not changing and just the number,please use mid function as shown below to extract the number from string
Code:
str="The value of sum is 88 77 88" num=mid(str,20,len(str)) msgbox num
Reply
#3
Thank you for your response, I have another question.
Now I got the numbers in the string like
str= 88 77 88
now I am confused a bit, I want to save these numbers in variables
like a=88
b=77
c=88

any suggestions?
Reply
#4
Hi,

I think there is a seperator in this string and seperator is " ", use split and save the value.

Regards,
Sankalp
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace a string in a word document with another string rekha.naik 8 16,894 11-14-2013, 12:58 PM
Last Post: pranikgarg
  where to declare variables?? ACCBAJPA 0 2,770 10-01-2013, 07:20 PM
Last Post: ACCBAJPA
  Save randomly generated string SomeIntern 1 2,791 08-27-2013, 12:36 AM
Last Post: SomeIntern
  Break up a string of text and variables csutter2002 3 4,444 03-20-2013, 06:58 AM
Last Post: basanth27
Question User-Defined Environment Variables vs. Global Variables vs. DataTable Values imzeeshan 0 3,492 11-16-2012, 01:51 AM
Last Post: imzeeshan

Forum Jump:


Users browsing this thread: 1 Guest(s)