I am trying to write a function to capture a string in another string.
I have two browsers and i have to capture the recently opened browser.i did it using creation time.
i have to point to the new browser.for that i have the browswer title but i dont have the page title or any identity for the page.my page title appears in the browser title.so i want to write a function to capture that string in a string.
my browser title is: http://winapp07.workmeter.com:8000 - Daily Staff - Microsoft Internet Explorer
i want to capture Daily Staff from the above string which is the page title and then using both i can point to the current browser.
please help in writing the function to capture a string in a string.
thank you so much
Use Split to split that string into elements of an array. The delimiter for the Split function woudl be your hyphen:
<font class="small">Code:</font><hr /><pre>strBrowserTitle = "http://winapp07.workmeter.com:8000 - Daily Staff - Microsoft Internet Explorer"
x = split(strBrowserTitle, "-")
strPageTitle = trim(x(1))
msgbox strPageTitle</pre><hr />
Don't forget to Trim your page title, since your Split function will leave the spaces in it. Or you could use " - " as your Spolit delimiter as long as you know there will always be spaces in the browser title around both hyphens.