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 / chaitanya

Option Explicit
Dim st,cnt,str,i,j
str = "happy"
For i=1 to len(str)
cnt =0
st = mid(str,i,1)
For j=1 to len(str)
If mid(str,j,1)=st Then
cnt =cnt +1
End If
Next
If cnt>1Then
msgbox st & " repeats " & cnt & "times"
End If
Next

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to integrate QTP with QC using VB Scripting? What are the prerequisites to connect with QC?

1272


What is the difference between per-action and shared?

585


What is the new version of qtp which is recently released in the market?

636


Explain the checkpoint in qtp?

584


Did the scripts need lot of maintenance? If yes, why?

3292






What are the different recording modes and how do they work?

610


I want to open a Notepad window without recording a test and I do not want to use System utility Run command as well. How do I do this?

615


What are the advantages of Object Repository?

580


How can you write the scripts that operate on different objects depending on run-time information?

2108


How QA specialist can identify when programmatic descriptions are useful?

1964


What is action?

570


Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?

1507


In QA Testing when do you use Loadrunner vs QTP? What are the main differences between those two tools? Explain the purpose with real world scenario examples...In advance thank you!!!

2375


How software tester can use constants and variables in scripts?

1682


how can i pass a "cript"as a parameter in to a function

1452