Function String Searches Class

MinLengthAnyPart

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

Signature (Visual Basic / VBA)

Public Function MinLengthAnyPart( _
      ByVal vValue As Variant _
    , ByVal vPartSep As Variant _
    ) As Variant

Code Example

    MinLengthAnyPart("This" + vbCrLf + "is", vbCrLf) = 2
    MinLengthAnyPart("This is a test.", " ") = 1
    MinLengthAnyPart("This is", vbCrLf) = 7

Parameters

Parameter Description
vValue The string containing the parts whose minimum 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.

Notes & Version History

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.
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.