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

Hi everybody.. I m using QTP 9.2 version., plz send me licence key is it seat or concurrent licence key... plzzzzzzzzz plz help me for this one and its Locking code:8-5C740 Maintenance number: 0123-2820602186.,

1 Answers  


write the vb script for call to new action in qtp?

0 Answers  


With help of object repository,we can able to write the descriptive program manually?

1 Answers  


Have you performed Debugging and how did you?

2 Answers  


I had created the new virtual objects for web application buttons. how to add those virtual objects into object repository. Previously i had used Gui map in winrunner for capturing virtual objects for web application. Please help me regarding this. need your answer quickly

1 Answers  






How to retrieve the property of an object in QTP?

5 Answers  


Can you write a script for to insert array elements in an excel A to Z columns only. if the number oe elements in the array is greater than the number of columns (A to Z), come to next row and proceed furthur. eah cell should contain only one array value.

1 Answers  


I have made the recovery scenario in script. When i am exceuting the script. it stop automatically after running recovery scenario. Please tell the resaon?

2 Answers  


who is the best faculty in HYD? Nageshwar rao or GC reddy?

3 Answers  


what is error and fault in terms of software quality?

0 Answers   TCS,


how to acess a test in RSA?

0 Answers   IBM,


How to make arguments optional in a function?

1 Answers   Crea,


Categories