str="QTP AUTOMATION TESTING"
here how many T are there in the str
finally i want to display the T

Answers were Sorted based on User's Feedback



str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / abin

str="QTP AUTOMATION TESTING"
a= ubound(split(str,"T"))
msgbox a

Is This Answer Correct ?    10 Yes 1 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / karthik

i am thinking this will correct ...because he want to count
how many T are there ,for that it's correct..
and finally he want to display the T ,just read the question
once again ...if i wrong let me know...

str="QTP AUTOMATION TESTING"
dim l,m,n,p
l=len(str)
for i=1 to l
m=mid(str,i,1)
if m="T" then
n=n & m
end if
next
p=len(n)
msgbox P
msgbox n

Is This Answer Correct ?    9 Yes 2 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / gabbar

msgbox len(str)-len(REPLACE(str,"T",""))

Is This Answer Correct ?    4 Yes 1 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / ganesh

excellent answer by gabbar..out put 5 came

but question is not over ..finally display T ?

what about T.........

Is This Answer Correct ?    0 Yes 0 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / prashaant kumar

str="QTP AUTOMATION TESTING"
a= split(str,"T")
msgbox ubound(a)
msgbox string(ubound(a),"T")

Is This Answer Correct ?    0 Yes 0 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / lak

Karthik is correct

Is This Answer Correct ?    0 Yes 0 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / pravati

x="qtp automation testingttt"
y=split(x,"t")
for i=0 to ubound(y)
msgbox ubound y(i)
next

Is This Answer Correct ?    0 Yes 0 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / cnu_thatavarthi

Dim strValue,i, blnFlag,incRement

strValue = "QTP AUTOMATION TESTING"
blnFlag = ""
incRement = 0
For i = 1 to Len(strValue)
If Ucase(mid(strValue,i,1)) = "T" Then
incRement = incRement+1
blnFlag = blnFlag &Ucase(mid(strValue,i,1))
End If
Next
Msgbox incRement 'Number of Ts are Displaying 5
Msgbox blnFlag

Is This Answer Correct ?    0 Yes 0 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / manjesh

a="QTP AUTOMATION TESTING"
b=split(a,"T")
c=Ubound(b)
msgbox c

Is This Answer Correct ?    0 Yes 0 No

str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to disp..

Answer / jay patel

dim str
str = "qtp automation testingttt"
a = split (str,"t")
for each x in a
msgbox x
next
msgbox ubound(a)

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More QTP Interview Questions

how to capture objects of remote deskop as it is capturing only window.

1 Answers   Wipro,


where we are going to write the descriptive programming.for example we are invoking qtp application where we are going to write that code

3 Answers  


What is the extension of script and object repositary files?

7 Answers   Maveric,


how do we know whether all objects are stored in the object repository or not? how can we know if a particular object is not stored in the repository?

0 Answers  


what r the send key commands in QTP why they r used

1 Answers  






Hi Friends, How to trap an error message on Web page through QTP. Example:- When I put wrong user id or Password on a web page, I get the error message. So when I add the error object in Reposatory, every time it shows as Login Failed Object exist, eventhough using corret login details. And if I do the same without adding the object it shows as object not found. This might be because while recording QTP takes every new page as _1 _2 _3 and so on. as below. Browser("XXXXX").Page("XXXXX_1"). >>login Browser("XXXXX").Page("XXXXX_2"). >>Inbox Browser("XXXXX").Page("XXXXX_3"). >>Sent Items I used below code. Browser("XXXXX").Page("XXXXX").WebEdit("firstname").Set strFN Browser("XXXXX").Page("XXXXX").WebEdit("lastname").Set strLN Browser("XXXXX").Page("XXXXX").WebEdit("userid").Set strUserID Browser("XXXXX").Page("XXXXX").WebEdit("password").Set strPass Browser("XXXXX").Page("XXXXX").WebButton("Login >").Click If Browser("XXXXX").Page("XXXXX_2").Image ("msg_icon_error").Exist 5 Then Reporter.ReportEvent micFail, "XXXXX", "Login Failed!" ExitRun (It shows login failed ever after login is passed. Else Reporter.ReportEvent micPass, "XXXXX", "Login Successful!" End If Please find out a way for me here, and provide me with the correct code. Thanks in Advance.

1 Answers  


What are the technics follow in writing VB script?

0 Answers   CTS,


what is the test object?

1 Answers  


What is the architecture of your project? Can any one answer for this question plz........

0 Answers  


what is the difference between link and hyper link?

1 Answers   Ordain Solutions,


How to export(copy) the entire webtable from the webpage into Excelsheet? using Vb scripting

9 Answers  


How to load object properties to object repository through scripting.give one example

7 Answers   IBM,


Categories