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 / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the qtp testing process?

781


Explain object spy in qtp.

765


How is recording done when a application is over lapping the QTP application it gives a message object not recorded

1728


To which environments does quicktest professional supports?

715


Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link

1038






in my application,validation message has in japanise language.how to validate this message is appears properly or not

1724


can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com

1954


If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?

756


Hi All, How to get repeated word in string . Thanks Balaji

1105


Give me detailed theritical explanation about keyword driven, hybrid framework, environment variables, hybrid frame work

1639


What are the different types of qtp test assets and their extensions?

815


whow much strong on VB and C?

1652


How do you do batch testing in wr and is it possible to do in qtp, if so explain?

664


What is a recovery scenario?

748


I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.

1448