how to calculate no. of repeating characters in a a
string..please give me the code

Answer Posted / amol ghule

' A shorter version of code

Option Explicit
Dim getChar,strLen,ascChar(),CharCount,i,UniqChar,getRes
getChar="TestmyKnowledge1221"
strLen=Len(getChar)
ReDim ascChar(strLen)

For i=0 to strLen-1
ascChar(i)=Mid(getChar,i+1,1)
getRes=Split(getChar,ascChar(i),-1,1)
If ubound(getRes)=1 Then
UniqChar=UniqChar&" "&ascChar(i)
End If

Next
msgbox UniqChar

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is action split used by qtp?

569


Can we use index on view?

1610


Suppose I want fail that check point? How can you do that?

607


What is the pros and cons between QTP and Rational Robot

3294


how can we compare descriptive programing with a regular expression

1929






Can we call qtp test from another test using scripting. Suppose there are 4 tests and I want to call these tests in a main script. Is this possible in qtp?

662


how can we preform retesting(DATA driven test) using function please gine the code for loginpage

2284


can u please explain what is the exact difference between qtp8.2 and 9.0

1688


Could anyone help me for the below scenario: i am using the descriptive programming for my account, in which we have to generate the contract in the MS-word. when i generate this doc, we need to click on enable macros to continue further. but i am unable to make qtp to click on this. if anybody faced the problem like this??? pls help to get it resolved? Thanks in advance

1412


What is qtpro? What is a quick test professional?

593


explain structured testing? plz guys with exp. do answer

1418


Hi Friends, Im planning to do certifcation in mercury Automation Tool QTP.But I Didnt get any clear details regarding course syllabus, fees, where to approach, and which certification would be useful for the experienced testers? can any one send me the details?

1528


How many types of recording modes in the qtp?

602


How to read a text file from QC using QTP. I would like to do something like this. But instead read a file from QC and NOT from my local drive. Set fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("C:\test.txt", ForReading) Thanks

2766


Hi All, issue is related to handling pop up script generated in IE, and run on mozilla. In App Under Test, when we get the alert pop ups, we just click ok button. if we need to run the same code on mozilla it will not identify . so we will check browser if browser(*).dialog(IE object).exits browser(*).dialog(IE object).winbutton(OK).click else 'by default mozilla browser(*).dialog(mozilla object).page(*).webbutton(OK).CLICK END IF But my qustion is. Do we write the above piece of code where ever we get such kind of pop ups from the application like alert pop up, confirmation pop up.... OR do we have any other alternative way to do this by using any functions in Recovery Scebarios? If Any of u know idea please do help me in this regard. or send answer to kravimb@gmail.com

1441