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


Please Help Members By Posting Answers For Below Questions

Explain about the test fusion report of quicktest professional?

729


Can you list some technologies that support qtp?

741


how to test Web application using QTP software

1519


give me an example where u used good judgement and logic in solving a problem

3558


can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?

1879


How can you write the scripts that operate on different objects depending on run-time information?

2330


What is the difference between byref and byval in qtp?

784


Explain how you can delete excel file in qtp?

798


How to handle dynamic objects in quicktest professional?

705


Your roles and responsibilities and daily tasks? (As automation tester)

2795


How to interact tool & application build in QTP?

1656


Name the properties you would use for identifying a browser and page when using descriptive programming?

741


what are the utilities and drivers

2037


what could go wrong with test automation?

1746


How do I lauch my test website using code from qtp in different environmet, uat and PPTE?

1701