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

Answer Posted / kajal

Function RepeatCharCountInString
RepStr = "Automation Using Test Complete"
Msgbox(RepStr)
RepStr = Replace(RepStr," ","")
RepStr = LCase(RepStr)
RepStr1 = RepStr
For i=1 to Len(RepStr)
RepStrChar = mid(RepStr1,i,1)
Count=0
For j=1 to Len(RepStr1)
Char = mid(RepStr1,j,1)
If(Char=RepStrChar) Then
Count = Count +1
End If
Next
If (Count = 0) Then
Exit For
End If
Msgbox(RepStrChar &" Count is " & Count)
RepStr1 = Replace(RepStr1,RepStrChar,"")
RepStr1 = RepStrChar+ RepStr1
Next
End Function

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If u r using library files (Instead of Check Points) , How do u do bitmap check ?

1444


What is the pros and cons between QTP and Rational Robot

3274


How to write business scripts using object repository with different scenarios

1376


What are table and db checkpoints?

584


any body can you help me what is the script to automate an comand promt

1965






what and how to answer for the question "tell me about yourself ?" for 3 years experience. can anyone say inj detail please... its urgent

1329


In an interview, what r the general questions asked in SQL which is realted to testing ?pls give me anwser to this question?

1428


I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so

2242


How to capture a window in QTP?

1518


Print the Prime numbers in below format only up to 20(Need commas also) 1,2,3,5,7,9,11,13,17,19

1171


What is output value? How many types of output values are there in qtp?

572


i have an external excel datasheet where it only contains 3 rows. after qtp executed the code to import the datasheet, the datatable getrowcount method now gives me a different value, lets say 60,000+ instead of only 3. i did not have any values starting from row 4 of my excel file. why is this happening? this also results to the qtp report to load for a very long time.

1521


what is ODC and GDC?

7319


what is the difference between development and testing

2346


What is method name to compare two XML files.

1528