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

Max Length Any Part Function
String Searches Class

Public Function MaxLengthAnyPart( _
      ByVal vValue As Variant _
    , ByVal vPartSep As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

"Maximum Length Any Part"
Return the maximum length of any part of the input string, after the string has been separated at each occurrence of the vPartSep string.

Examples:
    MaxLengthAnyPart("This" + vbCrLf + "is", vbCrLf) = 4
    MaxLengthAnyPart("This is a test.", " ") = 5
    MaxLengthAnyPart("This is", vbCrLf) = 7
See also:
    MaxLengthFileLines Function
    MaxLengthVariantVectorElement Function
Note: The separator string is not counted in the length of any of the parts.
Note: The lengths of the first segment of the string (the part between the beginning and the first occurrence of the separator) and the last segment of the string (between last occurrence of the separator and the end of the string) are checked--the function does not only check those string segments BETWEEN two separators.

vValue: The string containing the parts whose maximum length is to be returned. Function returns Null if rValue is Null or cannot be fixed up to a String.

vPartSep: The string which separates the parts of string vValue. Function returns Null if vPartSep is Null or cannot be fixed up to a String.
vCompare: Specifies the type of comparison used to determine if the separator string vPartSep appears 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.