Dear All,


To summaries all, we can find a conclusion that both Regular Expression(by
Gutam) and Split(by Ranja) will work but depending on the cases.

1.      If the search string(word) is unique then use Split.

Pro: If we want to find a word called ‘test’ out of the string ‘This is a
test for tester’. Then count will be 2, but actual result should be 1.
Otherwise always advice to use regular expression.

Regard,
Kapi Das


On Thu, Aug 28, 2014 at 11:13 PM, ranjan kumar <[email protected]> wrote:

> This ll give number of times a character or word is repeating
> s="hello how r u h"
> Msgbox ubound(split(s,"h"))
>
> Regards
> Ranjan
>
> On Tuesday, 26 August 2014 13:31:43 UTC+5:30, Gautham wrote:
>
>> With Regular Expression:
>>
>> count = 0
>> str_1= "This is a Test"
>>
>> Set regExp_1 = New RegExp
>> regExp_1.IgnoreCase = True
>> regExp_1.Global = True
>> regExp_1.Pattern = "t"
>>
>> Set str_match = regExp_1.Execute(str_1)
>> For Each Match in str_match
>>  count = count +1
>> Next
>> MsgBox "String Count:"&count
>>
>> Regards,
>> Gautham Maroli
>>
>>
>>
>> On Tue, Aug 26, 2014 at 6:45 AM, bhavin v patel <[email protected]>
>> wrote:
>>
>>> Good one..
>>> You can do with regrular expression..
>>>
>>>
>>>
>>>
>>> On Monday, August 25, 2014 4:26:47 AM UTC-4, Malluri Ramesh wrote:
>>>>
>>>> VBScript to find the number of times a particular character is repeated
>>>> in a given string.  without using len, mid, right, left
>>>>
>>>  --
>>> --
>>> You received this message because you are subscribed to the Google
>>> "QTP - HP Quick Test Professional - Automated Software Testing"
>>> group.
>>> To post to this group, send email to [email protected]
>>>
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>>
>>> For more options, visit this group at
>>> http://groups.google.com/group/MercuryQTP?hl=en
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "QTP - HP Quick Test Professional - Automated Software Testing"
>>> group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to