<-- Previous || Up || Next -->

Count Strings Function
String Searches Class

Public Function CountStrings( _
      ByVal vLine As Variant _
    , ByVal vFind As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Count the number of (non-overlapping) occurrences of the string vFind within vLine.

Examples:
    CountStrings("122333444455555", "55") = 2
    CountStrings("1223334444", "NEW") = 0
See also:
    CountLeadingStrings Function
    CountTrailingStrings Function
    CountOverlappingMatches Function
    CountLines Function
    CountCharacters Function
vLine: The string which is to be searched. Function returns Null if vLine is Null or cannot be fixed up to a String.

vFind: The string whose number of non-overlapping appearances within vLine is to be counted. Function returns Null if vFind is Null or cannot be fixed up to a String.

Function returns 0 (zero) if vFind is an empty string.

vCompare: Specifies the type of comparison used to find matching strings. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.