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

how do u manipulating INI, DLL and / or registry files in support of your test environment? actually what do u mean by INI and DLL or registry files. plzzz its urgent do answer

1444


what is meant by source control?

1693


How many types of recording modes in the qtp?

593


Who uses qtp tool?

575


how do we know whether all objects are stored in the object repository or not? how can we know if a particular object is not stored in the repository?

1310






How does you pass optional arguments in qtp?

565


Explain features of the latest version of qtp/ uft 12.1?

602


An object is non standard object, i mapped it to standard object, eventhogh on mapping to standard object i cannot use the methods available on the standard object with the mapped object. How i can use those standard object methods with these mapped object. (((Note : dont tell that we can use virtual object as virtual object is to map nonstandard obj to standard obj)))

1590


regular expression in qtp standar check point for months from accepting months from january to december only

1475


what is impact analysis on regression testing?

2046


Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out

1584


How will you find the current time of the remote machine using QTP script?

594


how many maximum number of virtual users we can create?

1570


Get the count of files of similar types from a folder.

975


This is Karthic and my mail id is karthic.venkitapathi@gmail.com, please give me an idea to crack qtp 10

1507