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

Swap Characters Function
String Manipulations Class

Public Function SwapCharacters( _
    ByVal vValue As Variant _
    ) As Variant

Swaps every other character within a string, so "ABCD" becomes "BADC".
Strings with an odd number of characters have their last character retained. as in example #2.

    SwapCharacters("ABCDEF") = "BADCFE"
    SwapCharacters("ABCDE") = "BADCE" ' #2
See also:
    ReverseEveryNCharacters Function
    ReverseString Function
vValue: The string whose pairs of character are to be reversed. Function returns Null if vValue is Null or cannot be fixed up to a String.

Swap adjacent bytes.

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