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

Hello Everybody, please tell me how to use accessibility checkpoint and XML checkpoint by giving any practical example of it.please provide me the steps to perform that and also pls provide the code too. Thanks in advance, Gaytri

1 Answers  


Can the mode of object repository be change during run time? Eg. if the mode is per-action during design time can i change it to shared and vice-versa? Any scripting possible?

2 Answers  


can any body clearly explain about hybridframework with the explanation for files what ever we come acros in this frame work?

4 Answers   Wipro,


we are submitting data one form to another form.defaultly it is time period set as 5sec. but it is taken 15sec what to do

5 Answers   Covansys,


how to reverse the string without using bultin functions(i.e mean mid,len ,reverse functions)

6 Answers   GE,






What is difference between web object and web items

2 Answers   Patni,


What are Test case selection criteria for Automation?

2 Answers  


What is quick test pro? What is a quick test professional?

0 Answers  


what is the use of Browser.sync()

2 Answers   NIIT,


what are the areas that cannot be tested using an automated tool? list a few

3 Answers  


In how many ways we can add check points to an application using QTP.

2 Answers   Infogain,


How to open a new test using quicktest professional?

0 Answers  


Categories