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

Character Every Nth Character Function
String Manipulations Class

Public Function CharacterEveryNthCharacter( _
      ByVal vString As Variant _
    , Optional ByVal vStart As Variant _
    , Optional ByVal vStep As Variant _
    ) As Variant

Extracts characters from a string by stepping through it vStep positions at a time.
Stops when the beginning or end of the source string vString is reached.
Inverse of the MergeStrings function.

Example:
    CharacterEveryNthCharacter("ABCDEFGHIJ", 2, 3) = "BEH"
See also:
    StringEveryNthCharacter Function
    StringEveryNthCharRepeated Function
    CharacterEveryNthCharacterSample Subroutine
vString: The string whose characters are to be samples. Function returns Null when vString is Null or cannot be fixed up to a String.

vStart: The starting character position within string vString. When missing or Null or non-numeric, vStart defaults to 1 (one) if vStep is positive, or vStart defaults to the length of vString if vStep is negative.

vStep: The number of character positions to move between each sample. Use a positive step to move from left-to-right and a negative step to move from right-to-left. vStep defaults to 1 (one) when it is missing or Null or cannot be fixed up to a number. Function returns an empty string when vStep is 0 (zero).

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