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 TOM in QTP?

1886


How is test case write?

664


How many tabs are available to view your test in a test pane and what are they?

676


If the objects hierarchy is changing from build to build, then how you will handle that condition?

711


Hi.. I want to do parametrization for selecting perticular flighr say XYZ by using local table: criteria: 1.If flight is available msgbox "Flight is available" and then select flight from flight table and click to ok button after that as enter username and ticket no and then stop 2. otherwise msgbox " Flight is not available" and stop Please help me out ..and let me know your responses on dipak.bachhav@gmail.com Regard, Dipak

1738






Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji

1422


How software automation specialist enter steps in the Expert View?

1763


How many number of actions possible in qtp?

693


What is a data driven test in qtp?

679


we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?

1748


Why we load add-ins in qtp?

723


Hi. I have completed B.TECH(CS) , But I will go to "SECURITY CONSOLE OPERATING" [C.C CAMERA abservation]. IF interviwer asks " Why you choose this job ?" What we will say? urgent.........................urgent...........

1537


1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?

1574


Does Low-level recording capture mouse movements?

672


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

1729