Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to store a value from InnerText property to an Array ?
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi there,



This webelement has an innerText property which has list of strings saperated by space/ enterkey. i need to check existance of particular string in this list. Is it possible to fetch these values into an array ?

or if someone has a better clue to do this ?

String returned in a variable like this -

Sunday
Monday
Tuesday

Alternatively, how can i take this value(s) to datatable please ?


please advise,



I will be grateful to u !!



Thanks





Shreyya
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Shreyya,

Refer the below example and implement accordingly.

Code:
str="Sunday Monday Tuesday"
d=Split(str," ")     [b]' here string 'str' got splitted using " " (single space) as a delimiter and an array 'd' got created.[/b]

For i=lbound(d) to Ubound(d)
     msgbox d(i)    [b] 'display the Array elements[/b]
     Datatable.Value("Test_Column",dtglobalsheet)=d(i)   [b]'Array Values will get posted into Run Time Datatable.[/b]
Next
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
What is the necessity of a array to find out existence of a particular substring in a string ?

this should do,
Code:
str = "Sunday Monday Tuesday"
strtoverify = "Monday"

If Instr(str, strtoverify) <> 0 Then
   msgbox "found"
Else
  msgbox "not found"
End If

I fail to understand what you would want to write to the Datatable ? Is it the Innertext ? I presume so, if thats the case then you can simply write it as,
Code:
Datatable.Value("Innertext",dtglobalsheet)=str


See if this helps !!!
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VB SCRIPT to click on specific links on webpage and store related data ACCBAJPA 1 9,995 04-02-2013, 01:33 PM
Last Post: ACCBAJPA
  Need help retrieving innertext of a link pujamukho 3 3,880 05-03-2011, 07:11 PM
Last Post: Charanpreet
  Is there any way to store different configurations of our datasheets and attach them advqtpuser 1 2,503 03-19-2011, 04:06 AM
Last Post: tdevick
  how can I store a string with variable in it, in another variable? reejais 4 4,600 11-11-2010, 11:46 PM
Last Post: smeepaga
  How to store all output values in different variables Jyobtech 4 4,732 10-13-2010, 11:23 AM
Last Post: KavitaPriyaCR

Forum Jump:


Users browsing this thread: 1 Guest(s)