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

Generic function to search for the unique link in webtable and click on it

2478


What is the limitation to XML Checkpoints?

1597


describe some problems that u had with automating testing tool?

1403


Is there any relation between Keyword Driven Framework and Recording modes provided in QTP( whether Recording modes are applied on keyword driven framework or not?)

1444


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

548






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.

1597


Explain advantages and disadvantages kdf?

514


Give me detailed theritical explanation about keyword driven, hybrid framework, environment variables, hybrid frame work

1436


Tell me one scenario, the complex functionality you have automated in your project?

1469


i have doubt suppose iam purly working in QTP, when i will work on sql and performence testing? pls any one clarify doubt?

1494


Discuss the QTP Environment?

615


What is checkpoints for quicktest professional (qtp)?

566


Hi, can explain the draw back of manual testing.plz send me the answer to my mail id deepthip1985@gmail.com

1405


How can i get the image text that changes dynamically? Here i have used "GetROProperty", but it's not working. I used like Ex:Browser("webmail").Page("inbox").image ("captchaimage).getroproperty("innertext/text/value")

1414


how can we compare descriptive programing with a regular expression

1912