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
How to integrate QTP with QC using VB Scripting? What are the prerequisites to connect with QC?
What is the difference between per-action and shared?
What is the new version of qtp which is recently released in the market?
Explain the checkpoint in qtp?
Did the scripts need lot of maintenance? If yes, why?
What are the different recording modes and how do they work?
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?
What are the advantages of Object Repository?
How can you write the scripts that operate on different objects depending on run-time information?
How QA specialist can identify when programmatic descriptions are useful?
What is action?
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?
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!!!
How software tester can use constants and variables in scripts?
how can i pass a "cript"as a parameter in to a function