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
Explain advantages and disadvantages kdf?
In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer
what type of automation is follwed in the project?
Hi All, How to Compare two strings character by character in QTP
hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.
What is difference in global and action sheet in qtp?
can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?
give me an example where u used good judgement and logic in solving a problem
I want to test my vb.net solution file using qtp. Does Qtp test only .exe file?
What is ObjectParamater?
How to do the scripting. Are there any inbuilt functions in QTP? What is the difference between them? How to handle script issues?
What is environment variable in qtp and why to use it?
How will you check a web application for broken links using qtp?
can any body give the banking domain concepts/links
How to use debug tools?