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 |
Hi..friends can anybody write the script for this question... Am having some 20 nos of links in a web application, i want to click some 5,13 & 17th links. So please....can anybody give the answer....??? -->Hani<--
How to find which type of Framework is suitable for which type of application?
If there are 10 notepads opened on desktop. how can we close a particular 2nd notepad using script
Hi all, In Every interview interview asking one question what type of challenges you have been faced in your project?
get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456
Do you know SQL? I know SQL but i don't have any experience...that's it..No more questions ...simply he said " you can leave for the day" ...guys prepare SQL Quires before attending interview in bank of america...
How to retrieve the data from database?
Hi, Can anyone please tell me how to connect the QC with QTP using QTP script? Thanks in advance
Please clarify Automation and QTP both(names) are same or diff?
Who is the best faculty for QTP in Hyderabad? Is it Mr. G.C.Reddy, some are referring his name?
Write the script to delete the mail which is at 9th,13th and 18th place in INBOX of Gmail ?
who is the best faculty in HYD? Nageshwar rao or GC reddy?