suppose im having a string wipro123xyz i need to get the
value 123 only from the string today 123 will be in the
middle from tommorow it will be changing to front or back
how to get the no if it changes continously?

Answers were Sorted based on User's Feedback



suppose im having a string wipro123xyz i need to get the value 123 only from the string today 123 w..

Answer / sailaja

txt="123wiproxyz"
mypos=instr (1,txt,"123")
msgbox mypos


k=mid ( txt,mypos,3)
msgbox k

Is This Answer Correct ?    7 Yes 1 No

suppose im having a string wipro123xyz i need to get the value 123 only from the string today 123 w..

Answer / aiswaryan

Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & Match.Value' & vbCRLF
Next
RegExpTest = RetStr
End Function
a=(RegExpTest("[0-9]", "1234_Today"))
msgbox(a)
"a" contains the numbers in the given string from 1st to
last position.
If anybody know smarter way to achieve above task, please
post the answer.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More QTP Interview Questions

How can we see the analog recording steps in QTP..the Steps are stored in a track file with an extension .dat..how can we open the file..

1 Answers  


Name the different types of recording modes?

0 Answers  


Hello Everyone, I have a problem. QTP is capturing no action on a particular page in the application that I am trying to automate. But on the same side its working fine on other pages of the same application. Can someone please help me understand the reason behind this inconsistency.

1 Answers  


Hi, How Accessibility checkpoint in QTP can be implemented in the test script?

0 Answers  


Explain about the quicktest professional (qtp) automation object model?

0 Answers  






Why we have to split actions in a test?

4 Answers  


can any one tell me how to select some text.i need the script for that

1 Answers  


why can't you use excel directly in qtp. why we want to import excel data into Datatable.

1 Answers   BoA,


X flies from Hyd to bangalore using different methods of transportation. write the test scenarios and test cases for this?

0 Answers   Virtusa,


Action1: I have a value "test" stored in a variable X. I want to use that variable X in Action2 .. how?

1 Answers  


How to replay a script in qtp?

0 Answers  


1.what is the extension of action template? 2.what are the strengths and weaknesses of Keyword driven framework? 3.how qtp identify runtime objects?

1 Answers   Satyam,


Categories