Please let know the scripts for counting number of repeated
letters in the word. Note repeated letter should not be
count agian.
Ex: If "Hello" is my word... l is coming twice.. it should
count once and print... secong 'l' should not count again..
Answer Posted / vishala
An optimised code with one loop:
strsting = "HelLo"
strnew = ""
For i = 1 To Len(strsting)
If InStr(1, strnew, Mid(strsting, i, 1), vbTextCompare) = 0 Then
strnew = Mid(strsting, i, 1) & strnew
strarr = Split(strsting, Mid(strsting, i, 1), -1, vbTextCompare)
If UBound(strarr) > 1 Then
MsgBox Mid(strsting, i, 1) & " is repeated " & _
UBound(strarr) & "times"
End If
End If
Next
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Explain about the test fusion report of quicktest professional?
Can you list some technologies that support qtp?
how to test Web application using QTP software
give me an example where u used good judgement and logic in solving a problem
can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?
How can you write the scripts that operate on different objects depending on run-time information?
What is the difference between byref and byval in qtp?
Explain how you can delete excel file in qtp?
How to handle dynamic objects in quicktest professional?
Your roles and responsibilities and daily tasks? (As automation tester)
How to interact tool & application build in QTP?
Name the properties you would use for identifying a browser and page when using descriptive programming?
what are the utilities and drivers
what could go wrong with test automation?
How do I lauch my test website using code from qtp in different environmet, uat and PPTE?