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

What is the difference between local and shared object repository in qtp?

567


What are the views available in quicktest professional?

563


What are benefits of qtp?

587


What is the Command used to start the QTP

1533


Why is Client side image is preferred over server side image?

1446






What are the trigger events in qtp?

576


Explain advantages and disadvantages of ddf?

603


I want to configure the OR and library files to a particular QTP test during run time. Note: OR and Library files are located in Quality Center. Is it possible in QTP? Anybody having code?

1375


.have you ever written compiled module? if yes , tell me about some of the function that you wrote.

1684


In an interview, what r the general questions asked in SQL which is realted to testing ?pls give me anwser to this question?

1443


Explain different types of checkpoints?

562


On what document base Descriptive programming is written if build is not yet ready ?

882


what is the difference between the modular framework and datadriven frame work

1920


What are the recording modes in wave event?

1540


They asked by using qtp recording writing scripting

2074