Function String Lists Class

StringToStringSegments

Take the delimited portions of a string like "CA|Calif|NV|Nevada" and place them into equal-length segments. The length of each segment is the length of the longest delimited portion within vValue.

Signature (Visual Basic / VBA)

Public Function StringToStringSegments( _
      ByVal vValue As Variant _
    , ByVal vSeparator As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Code Example

    StringToStringSegments("CA|Calif|NV|Nevada") = "CA    Calif NV    Nevada"
    StringToStringSegments("Ariz|Calif|Nev|Wash") = "Ariz CalifNev  Wash "

Parameters

Parameter Description
vValue The string containing the delimited portions that are to be placed into equal-length segments. Function returns Null if vValue is Null or cannot be fixed up to a String. Function returns an empty string if vValue is an empty string.
vSeparator The string which separates each of the portions of vValue. vSeparator defaults to an empty string if it is Null or cannot be fixed up to a String. Function returns vValue unchanged if the separator is an empty string (it creates a string with one segment).
vCompare Specifies the type of comparison used to determine if strings match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.