/*
 * $Id: charswap.txt 15102 2010-07-14 12:48:39Z vszakats $
 */

/*  $DOC$
 *  $FUNCNAME$
 *      CHARSWAP()
 *  $CATEGORY$
 *      CT3 string functions
 *  $ONELINER$
 *      Swap neighbouring characters in a string
 *  $SYNTAX$
 *      CHARSWAP (<[@]cString>) -> cSwappedString
 *  $ARGUMENTS$
 *      <[@]cString>      is the string that should be processed
 *  $RETURNS$
 *      <cSwappedString>  a string where neighbour characters are swapped
 *  $DESCRIPTION$
 *      The CHARSWAP() function loops through <cString> in steps of two
 *      characters and exchanges the characters from the odd and the even
 *      positions.
 *      By setting the CSETREF() switch to .T., one can omit the return value
 *      of this functin, but one must then pass <cString> by reference.
 *  $EXAMPLES$
 *      ? CHARSWAP("0123456789")   // "1032547698"
 *      ? CHARSWAP("ABCDEFGHIJK")  // "BADCFEHGJIK"
 *  $TESTS$
 *      CHARSWAP("0123456789")  == "1032547698"
 *      CHARSWAP("ABCDEFGHIJK") == "BADCFEHGJIK"
 *  $STATUS$
 *      Ready
 *  $COMPLIANCE$
 *      CHARSWAP() is compatible with CT3's CHARSWAP().
 *  $PLATFORMS$
 *      All
 *  $FILES$
 *      Source is charswap.c, library is libct.
 *  $SEEALSO$
 *      WORDSWAP(),CSETREF()
 *  $END$
 */

/*  $DOC$
 *  $FUNCNAME$
 *      WORDSWAP()
 *  $CATEGORY$
 *      CT3 string functions
 *  $ONELINER$
 *      Swap neighbouring double characters in a string
 *  $SYNTAX$
 *      WORDSWAP (<[@]cString> [, <lSwapCharacters>]) -> cSwappedString
 *  $ARGUMENTS$
 *      <[@]cString>         is the string that should be processed
 *      [<lSwapCharacters>]  specifies whether an additional swap should be
 *                           done within the double characters
 *                           Default: .F., no additional swap
 *  $RETURNS$
 *      <cSwappedString>  a string where neighbouring double characters are
 *                        swapped
 *  $DESCRIPTION$
 *      The WORDSWAP() function loops through <cString> in steps of four
 *      characters and exchanges the double characters from the first and
 *      second position with the one from the third and forth position.
 *      Additionally the function can perform a swap of the both char of
 *      each double character.
 *      By setting the CSETREF() switch to .T., one can omit the return value
 *      of this functin, but one must then pass <cString> by reference.
 *  $EXAMPLES$
 *      ? WORDSWAP("1234567890")        // "3412785690"
 *      ? WORDSWAP("1234567890", .t.)   // "4321876590"
 *  $TESTS$
 *      WORDSWAP("1234567890")      == "3412785690"
 *      WORDSWAP("1234567890", .t.) == "4321876590"
 *  $STATUS$
 *      Ready
 *  $COMPLIANCE$
 *      WORDSWAP() is compatible with CT3's WORDSWAP().
 *  $PLATFORMS$
 *      All
 *  $FILES$
 *      Source is charswap.c, library is libct.
 *  $SEEALSO$
 *      CHARSWAP(),CSETREF()
 *  $END$
 */
