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

Answers were Sorted based on User's Feedback



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

Answer / sandeeo

A="God is Great"
Cnt=split(A,"G")
msgbox Ubound(Cnt+1)

Is This Answer Correct ?    0 Yes 1 No

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

Answer / venky

mystring = "mississipi"
slen=Len(mystring)
msgbox slen
ws=Len(replace(Mystring,"s",""))
msgbox ws
charcount=Len(mystring)-Len(replace(Mystring,"s",""))
msgbox charcount

Is This Answer Correct ?    1 Yes 3 No

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

Answer / devi

The above script is correct. Apart from that script i have
one more script for finding no. of repeated characters in a
string

Suppose we have to know how many "s" are there in mississipi

code follows:

mystring = "mississipi"
charcount=len(mystring)-len(replace("s",""))
msgbox charcount

then output is : 4

Is This Answer Correct ?    6 Yes 11 No

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

Answer / devi

in above some mistake is there

sorry for that

charcount=len(mystring)-len(mystring,replace("s",""))

this is the correct one

Is This Answer Correct ?    2 Yes 10 No

Post New Answer

More QTP Interview Questions

what are the mandatory properties for a tex boxc (scenario?)

0 Answers  


hi, Can any body tell me whats the difference between the QTP and the Rational Robat ad the Silk Test and LOad Runner and are they used in any Company On the Major scale bcas I finnf Many comapny Using the Manual Testing Only Hence Askin the Question Hope I will get the Assitence .

1 Answers   First Europa,


what is the framework followed by ur company in qtp

5 Answers  


What is the difference between Keyword Driven test and Data Driven test?

0 Answers  


what is the difference between Automation object model(AOM) and test object model(TOM)

2 Answers   UHG,


Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?

0 Answers   CTS,


4. How u will open the build automatically in QTP except using Systemutil.run command

4 Answers  


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

0 Answers  


How to Analyze the Checpoint results with Standard Checpoint ?

1 Answers  


What are the Mandatory Properties of WebTable Object and Link Object in Web testing using QTP

2 Answers   iLink,


Have you faced any problems with object repository?

0 Answers  


how can i call function (which has link with excell sheet at a remote location) within another function

0 Answers  


Categories