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,Sudhanandareddy plz forword framework and ppts for QTP to me. This is my mail id: ranjith_99reddy@yahoo.co.in (your contact number also)
IF we use batch testing.the result shown for last action only.in that how can i get result for every action.
How to handle recovery scenario for a application crash.write script for this.
If we write a script in the expert view how are the objects created in the object repository? to be clear i will explain my problem first i have recorded the mercurytours application by providing the link www.mercurytours.com and all the objects are stored in the object repository ok this is fine. but i have copied the script generated in the above processes and pasted in a new test and tried to run that script but as the objects were not stored in the object repository it showed an error (The "Welcome: Mercury Tours" object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object).so how can i overcome that error
In QTP while testing 3 tier application, It is Java Based Application developed using Java, servelets and JDBC etc... and It is a Web based Application.. which Add-In do we need to select while testing ...Java or Web Add-In
how can we perform web datatable operations on webpages(Like rowcount,col count,cell data)?
Could you please any one give code for the following ? Scenario : Suppose a excel file contains 10 records and earch have 5 fields. how can i input this excel file for datadrive wizard ? Please explain
I want to execute 1st row of the local sheet and 3rd row of the global sheet parellely. write script to execute
Explain different type of event trigger option.
what are pretesting activities
what is Smart identification
How do i relate the checkbox properties with webelement when checkbox properties are changing on every login to the application