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

Rotate String Right Function
String Manipulations Class

Public Function RotateStringRight( _
      ByVal vValue As Variant _
    , Optional ByVal vPositions As Variant _
    ) As Variant

Rotates the characters within a string to the right by vPositions, taking the last vPositions characters within the string and placing them at the beginning of the string.

Examples:
    RotateStringRight("123456789", 3) = "789123456"
    RotateStringRight("123456789", 12) = "789123456" ' #2
    RotateStringRight("123456789", -3) = "456789123" ' #3
See also:
    RotateStringLeft Function
    RotateString Function
    ShiftStringRight Function
    StringRotateRight Function
vValue: The string whose characters are to be rotated to the right. Function returns Null if vValue is Null or cannot be fixed up to a String.

vPositions: The number of positions that each character is to be rotated. vPositions defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number.

vPositions can be greater than the length of the string, as in example #2.

vPositions can be negative in which case the string is shifted to the left, as in example #3.

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