Function String Manipulations Class

SplitStrings

Takes the characters in odd-numbered positions within string vValue and places them within rOddPosChars and takes the characters in even-numbered positions within vValue and places then within rEvenPosChars.

Signature (Visual Basic / VBA)

Public Function SplitStrings( _
      ByRef rOddPosChars As Variant _
    , ByRef rEvenPosChars As Variant _
    , ByVal vValue As Variant _
    ) As Boolean

Code Example

       Dim strOdd As String
       Dim strEvn As String
       SplitStrings(strOdd, strEvn, "123456789")
    is more efficient than
       strOdd = CharacterEveryNthCharacter("123456789", 1, 2)
       strEvn = CharacterEveryNthCharacter("123456789", 2, 2)
    After these examples
       strOdd = "13579"
       strEvn = "2468"

Parameters

Parameter Description
rOddPosChars The String or Variant which is to receive the vValue characters in odd-numbered positions.
rEvenPosChars The String or Variant which is to receive the vValue characters in even-numbered positions.
vValue The string whose odd- and even-positioned characters are to be assigned to separate strings. Function returns False if vValue is Null or cannot be fixed up to a String.