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

Answer Posted / arunkumar vikram r k

Hi Amol, a small change in your script and the repeated characters can be printed or counted

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

For i=1 to strLen
ascChar(i)=Mid(getChar,i,1)

Next
For i=1 to strLen
getRes=Split(getChar,ascChar(i),-1,1)
If ubound(getRes)=2 Then
RepChar=RepChar&" "&ascChar(i)
End If
Next
msgbox RepChar

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to start recording using quicktest professional?

817


When do go for loop condition in test?

823


Does any one worked on JIL Emulator , Testing with QTP(automation). Trail Version of QTP is not identifying the child objects of JIL emulator, Can any one help me out ,

1579


tell me abt a time when u had to go above &beyind the call of duty to get the job done

1645


How do you configure QTP AND Test director?

1673






What is method name to compare two XML files.

1715


What are test settings and global settings?

771


Describe how Smart Identification is used

1864


What the differences are and best practical application of Object Repository?

794


how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??

1791


Both static and dynamic arrays are handled by the vb script. Is it true?

761


You will receive the mail in your outlook from client at night time to go ahead for the execution. Based on the mail you need to trigger the batch run. What is the QTP Code for this?

1543


• What type of testing questions will be asked for 2+ yrs exp people in interview?

1455


The hybrid framework can be implemented for any application. Is it true?

764


When we r doing data driven test with chkpts, i want to insert formulae in data sheet but i didn't get. How we wil do that plz. explain in detail.

1809