Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Count occurences of string


'one way to do it
Count = Ubound (Split(Source,SearchString))

'alternate
Count = Len(Source) - Len(Replace(Source, SearchString, Mid $(Search,2)))