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

Batch testing in howmany ways u perfrom in QTP

3 Answers   Lehman Brothers,


suppose our project is developed using java technologies.after complition of the coding developer relesed a build to the testing team.so, what is the process means how we open that documents?what are that documents?plz give reply its urgent

2 Answers  


i want to learn testing tools what i have to know before.iam fresher i dnt know any this..which langagues i have to before testing.

2 Answers   Wipro,


How to add a runtime parameter to a datasheet?

1 Answers   Crea,


I am having major problems with some DB Table Checkpoints I add to my script. I 35 web based applications recorded and each has DB Table Checkpoints insert but only 1 script isn't recognizing the DB Table Checkpoints for some reason. I've checked the DB connections and the info in the Library Functions and still only this one script out of 35 doesn't recognize the DB Table Checkpoints. Can someone please help me figure out why only this one script out of 35 that's hitting the same database is having a problem.

0 Answers  






What is the extension of the qtp local repository?

0 Answers  


Explain the terms test and business component?

0 Answers  


plz anybody tell me how to explain the architecture of one particular project.plz give me answer for this.....RAJESH

7 Answers   TCS, Wipro,


what is Unicoad Compatibility ???? HOw does this makes a diffrence from Winrunner.???

1 Answers   GE,


How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find the script which i tried... Dim objBugFactory, objBug Dim BugId Set TDConnection = QCUtil.TDConnection Set objBug = TDConnection.BugFactory If QCUtil.IsConnected then Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) +"Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName Reporter.ReportEvent 0, "Current time on server is","==>" & TDConnection.ServerTime Else Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center" End If If mybug.Status="Open" Then BugId=mybug.DefectId MsgBox BugId End If 'OR**********************************--------------------- -----********************************** If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then BugId=Bug_Fields("BG_BUG_ID").Value MsgBox BugId End If

0 Answers   TCS,


What is the concept of hooking in QTP?

1 Answers  


I am in need of some set of QTP FAQ @ interview. Also recently in one of interview portal they asked me how you write the script for Login application which it is web -based and using Descriptive Programming? Without associating the shared object repository?Please i do need this answer very soon? Please respond me soon @ vaisu72@yahoo.com

2 Answers  


Categories