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

Merge Strings Function
String Manipulations Class

Public Function MergeStrings( _
      ByVal vOddPosChars As Variant _
    , ByVal vEvenPosChars As Variant _
    ) As Variant

Creates a string by interspersing the characters from the two input strings.
Inverse of the SplitStrings and CharacterEveryNthCharacter functions.

Examples:
    MergeStrings("12345", "ABCDE") = "1A2B3C4D5E"
    MergeStrings("12345", "ABCDEFGHIJ") = "1A2B3C4D5E" ' #2
See also:
    SplitStrings Function
    CharacterEveryNthCharacter Function
Note: If the two strings have different lengths, the characters in the longer string past the length of the shorter strings are ignored, as in example #2 where "FGHIJ" is ignored--the function does not return something like
    "1A2B3C4D5EFGHIJ" or "1A2B3C4D5E F G H I J"
vOddPosChars: The string containing the characters which will fill the odd-numbered character positions in the result. Function returns Null if vOddPosChars is Null or cannot be fixed up to a String.

vEvenPosChars: The string containing the characters which will fill the even-numbered character positions in the result. Function returns Null if vEvenPosChars is Null or cannot be fixed up to a String.

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