Hi...
Can anybody help me to write the vbscript for this
question..!!! Am having a string "HELLO WORLD", i want to
find how many "L"s are there.....?????
--> HANEEF <--
Answers were Sorted based on User's Feedback
str = "HELLO WORLD"
Set regex = New RegExp
regex.pattern = "L"
regex.Global = True
Set matches = regex.Execute(str)
msgbox matches.count
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / nagk24
here one more using loops and inbuilt functions
cnt=0
a="HELLO WORLD"
For i=1 to len(a)
n=mid(a,i,1)
If asc(n)=asc("L")Then
cnt=cnt+1
End If
Next
print cnt
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / rajasekar
dim str,strcount,strdis
str="welcome"
strcount=split(str,"l")
strdis=ubound(strcount)
print "count" & strdis
| Is This Answer Correct ? | 3 Yes | 2 No |
str = "HELLO WORLD"
str1=Replace(str,"L","")
cnt=len(str)-len(str1)
msgbox "Number of L's in str is:" cnt
| Is This Answer Correct ? | 0 Yes | 0 No |
Wat is the command used to add an object(properties) to an object repository?
I have a login page like username, password and login. I have to pass the 50 user names and 50 passwords but how can i test this page with out using parameters?
can we install qtp in windows vista
what is the hierachy of Descreptive programming?
what are pretesting activities
Please explain the role of Regular expression in QTP
what is run action?
How to switch between browser tabs? )moving from one tab to another tab)
Local Obj Repository and SOR are editable know, y we have to edit those.. i mean in which situation we need to edit those and how to do..? pls help me..
Please mail me the license key of QTP 9.5 t v.sadangi@gmail.com ????? thx
hi i want write code for "test engineer" in this i want write reverse how ca plz let me know through script
Object repositories types, which and when to use?