[dba-VB] Count a character in a string

Max Wanadoo max.wanadoo at gmail.com
Sun Apr 13 04:14:06 CDT 2008


John,

Further to my example RegExpr code that I just posted.
Would you have time to compare how long it takes and how long these two take
(posted by others):


> One:
> Dim strRecordLine() as array
> strRecordline=split(yourstringhere,"|")
> NumberOfSeperatorCharacters=UBound(strRecordline)+1
> 
> Two:
> Dim strTemp as String
> strTemp=Replace(yourstring,"|","")
> #ofCharacters=Len(yourstring)-len(strTemp)

It would be really nice to get a handle on which of these is the faster for
a very large file.

Thanks

Max




More information about the dba-VB mailing list