Another Way to Retrieve the Count of a String Within Another String
Category:
String ManipulationType:
SnippetsDifficulty:
AdvancedAuthor:
AnonymousVersion Compatibility: Visual Basic 6
More information:
Counts the number of occurrences of one string within another string, with one line of actual code. Also doesn't require the creation of a temporary array to hold the return from a split() function call, which makes it slightly faster for very long strings such as text files.
Instructions: Copy the declarations and code below and paste directly into your VB project.
Declarations: