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..



Please let know the scripts for counting number of repeated letters in the word. Note repeated lett..

Answer / mahesh.k

str=inputbox("enter a string")
ln=len(str)
nr=0
cnt=0
For i=1 to ln
If cnt>0 Then
nr=nr+1
End If
cnt=0
If strcomp(x,mid(str,i,1))<>0 Then
For j=i+1 to ln
If mid(str,i,1)=mid(str,j,1) then
cnt=cnt+1
x=mid(str,i,1)
end if
next
else
i=i+1

End If
Next
msgbox "no.of repeeted charecters="&nr

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

I have 5 no.of Action in my Test. Out off which i should make 3rd action as my start-up action. How should i make it?

9 Answers   IBM,


How do you check ticket cost and ticket number in flight application?

0 Answers  


what is the difference between data table and spread sheet?

1 Answers  


what are the different kinds of frameworks in automation?

2 Answers   Accenture,


Tell me about your project? please help me how to tell about insurance project

0 Answers   Cap Gemini,






What is quicktest professional window?

0 Answers  


How did you use regular expressions in QTP and also in WR?

0 Answers  


QTP Testing Process?

1 Answers  


Hi All, I have QTP installed on my machine but the application under test is on remote machine. I need to automate the scenarios which consist of automatically enter the remote machine through IP address ,record the application in remote machine and run it also when played. Can some one tell how to record the application in remote machine.

0 Answers  


why we use check points , In qtp we use the any check points , what r they , when and why

1 Answers   Polaris,


Plz give the vb script for the following scenerio I have faced one issues while doing test in QTP. I have described the scenario below. 1. I have to test web application.In that i want to select from the drop down values in the application. 2. Suppose Drop down has 5 value "A,B,C,D,E".I would like to give value from data table of QTP. 3. For every iliteration it should select A,then B and so on

0 Answers  


How to customize checkpoints with parameters?

0 Answers  


Categories