The string is like POWER STAR PAVAN , write a script for
this how to findout the number of "A" in the string ?
Answers were Sorted based on User's Feedback
Answer / uday
str="POWER STAR PAVAN"
counter=0
For i=1 to len(str)
strChar=mid(str,i,1)
If strChar="A" Then
counter=counter+1
End If
Next
msgbox counter
| Is This Answer Correct ? | 17 Yes | 0 No |
Dim oArray
Dim ochr
oStr="POWER STAR PAVAN"
ochr="A"
oArray=split(oStr,ochr)
print ubound(oArray)
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / ram
str="POWER STAR PAVAN"
len1=len(str)
str=replace(str,"a", "")
len2=len(str)
a=len1-len2
msgbox a
| Is This Answer Correct ? | 6 Yes | 5 No |
Answer / goms
Val="POWER STAR PAVAN"
If instr(Val,"A")>0 then
Msgbox "Pass"
Else
Msgbox "Fail"
End IF
Note: If instr function returns the position of the value.
If it is greater than 0, the letter is in the particular
variable
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / madhulika
function VerifyLetters(S_String,S_Pattern,MatchStr)
Set OReg = new RegExp
Set S_Pattern = OReg.Pattern
OReg.IgnoreCase = True
OReg.Global = MatchStr
Set Matches = OReg.Test(S_String)
MatchFound = Matches.count
VerifyLetters = MatchFound
End Function
-------------------------------------
val = "Power star pavan"
'Calling function
msgbox VerifyLetters(val,"A",True)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / seru
str="POWER STAR PAVAN"
Number_of_A=Len(str)-Len(Replace(str,"A",""))
msgbox Number_of_A
Answer is 3
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ravi
str="POWER STAR PAVAN"
len1=len(str)
msgbox len1
str=replace(str,"A", "")
len2=len(str)
msgbox len2
a=len1-len2
msgbox a
| Is This Answer Correct ? | 1 Yes | 3 No |
Hi All,I am in wierd situation that my laptop is installed with QTP11 and os is xp sp3.The problem is the descriptive programming which i have written is working in other laptops and it is not working in my laptop.it is clicking the link which is above the testbox instead of typing it in textbox below it.It is same with the other working scripts written by another person.
There is web page with the webtable,this contains some data, how do you manipulate the data.
what is KEYWORD DRIVEN TESTING ? I M NOT ASKIN WHAT IS KEY WORD VIEW PLZ ANS FOR ONLY WHAT IS KEYWORD DRIVEN TESTING EXACTLY THANX
How do we connect QC by using QTP?
Where are the snapshots stored?
Anybody wants to learn QTP with realtime implementations and complete framework desiging plz contact to this mail id ciraaj@gmail.com
hi i have one isuue on selecting webcheckbox .there are 15 wecheckboxex i want to select every time 9 th one how can i select plese help me regards balaji
How to call .vbs functions in QTP? plz Explain indetail
How to get align property of the link on web page?
Function to convert lowercase to uppercase in QTP Pls anybody can give the answer.. Thanks in advance...
i'm using QTP 8.2. A person using QTP 9.0 sends me a QTP TestScript, same when i try to open , an error comes "unexpected file format". Why?? and how to resolve the problem??
how to create user defined functions in QTP? can any one expalin me with example.. Thanks in Advance for help