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

Shuffle String Segments Function
String Lists Class

Public Function ShuffleStringSegments( _
      ByVal vString As Variant _
    , ByVal vSegmentLength As Variant _
    ) As Variant

Randomly shuffle the sub-string segments contained in vString.

Examples:
    Rnd(-1) = 0.224007
    ShuffleStringSegments("AZ CA NV OR WA ", 3) = "CA NV OR AZ WA "
    ShuffleStringSegments("AZ CA NV OR WA ", 3) = "NV AZ CA WA OR "
Note: The call to the Visual Basic Rnd function in the above example seeds the Visual Basic random number generator so that the sample results can be reproduced. There is generally no need to call the Rnd function within your programs since Entisoft Tools initializes the Visual Basic random number generator once with "Randomize" statement.
See also:
    ShuffleString Function
    ShuffleVariantVector Function
Note: The following two statements are equivalent, though because randomness is involved, they will seldom be equal:
    ShuffleStringSegments("ABCDEF", 1)
    ShuffleString("ABCDEF")
vString: String containing the equal-length segments which are to be randomly shuffled. Function returns Null if vString is Null or cannot be fixed up to a String.

vSegmentLength: The length of each sub-string segment within string vValue. vSegmentLength defaults to 1 (one) if it is Null or cannot be fixed up to a number.
Note: Using a segment length of 1 (one) has the same effect as calling the ShuffleString function--individual characters are shuffled.

Function returns Null if the segment length is < 1 (less than one).

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