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

An optimised code with one loop:

strsting = "HelLo"
strnew = ""
For i = 1 To Len(strsting)
If InStr(1, strnew, Mid(strsting, i, 1), vbTextCompare) = 0 Then
strnew = Mid(strsting, i, 1) & strnew
strarr = Split(strsting, Mid(strsting, i, 1), -1, vbTextCompare)
If UBound(strarr) > 1 Then
MsgBox Mid(strsting, i, 1) & " is repeated " & _
UBound(strarr) & "times"
End If
End If
Next

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we handle run-time errors?

570


Explain about datafile/verification of date file when file is not available in local system?

2218


What is Port testing. Whhen will you perform?

1490


Differences between text and test area checkpoints?

570


How to Test the mainframe application?

1816






Explain qtp(quick test professional)?

570


What is ObjectParamater?

1569


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

590


Which environments are supported by hp qtp?

594


Can anyone pls tell me how to do action parameterization (input and output parameters) with respect to login window and insert order of flight reservation window in detail( pls give a clear step by step explanation with example) anyone please. Will be very thankful to u

1367


write the vb script for call to new action in qtp?

1853


What is an object repository?

597


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What's the difference between them? How to handle script issues?

523


Hi, my requirement is to make a query in SQL using QTP. And i have to get the results of that query and i have to use those results for future testing. I created a driver but i dont know the code for using this Driver. please help me by providing the solution for y requorement

1634


What is the default add-ins in qtp?

550