Public Function AverageLengthAnyPart( _ ByVal vValue As Variant _ , Optional ByVal vPartSeparator As Variant _ , Optional ByVal vCompare As Variant _ ) As Variant
AverageLengthAnyPart("This is a test." , " ") = 2.75 AverageLengthAnyPart("This is a test." + vbCrLf + "Hello world.", vbCrLf) = 13.5 AverageLengthAnyPart("This is a test." + vbCrLf + "Hello world.", Null) = 29See also:
CountStrings FunctionvValue: The string containing the "parts" whose lengths are to be averaged. Function returns Null if vValue is Null or cannot be fixed up to a String.
vPartSeparator: The string which separates the parts of vValue. Function returns the length of vString if vPartSeparator is missing or Null or cannot be fixed up to a String.
Use a space character as the separator to calculate the average length of words within the string (assuming that each word is separated by a single space).
Use carriage return and line feed as the separator to calculate the average length of lines within the string (assuming that each line is separated by carriage return and new line characters).
vCompare: Specifies the type of comparison used to find separator strings within the string vValue. 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.