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

explain keyword driven framework with banking domain?

0 Answers   TCS,


How to capture text from image to word

2 Answers  


How to get line numbers in your editor in expert view?

2 Answers  


We are calling Actions in Expert View by using Run Action.but i want to know where we are saving the Actions Scripts.Pls explain??

1 Answers  


How many number of actions possible in qtp?

0 Answers  






hi gavasker i want how to merg OR's in QTP 8.2 by QTP Plus

1 Answers  


types of output value in details.

4 Answers  


Hi, one script having 10 Actions,but i want to execute only 3rd action and 7th action? how to execute selected actions? throgh script and through navigation?

2 Answers   IBM,


What are the various automation frameworks available in qtp?

0 Answers  


hi all i have qtp 9.0, Active screen is not working means after recording script snap shots not displayed in Active screen window. i have all ready check all setting means Tool...>option...>Active screen...>Default Level button is disabled. Is there other setting is remain to set Pls help i m new for qtp

1 Answers  


Can anybody help me for vb script in qtp? give me examples for practice plz.

0 Answers  


WHAT ARE THE DISADVANTAGES OF SHARED REPOSITORY?

9 Answers   BirlaSoft,


Categories