View Single Post
Old 08-19-2008   #4 (permalink)
Pegasus \(MVP\)


 
 

Re: How to Randomize characters in a string

Let's assume your have name="Rick". Using my method, you generate
an array containing four randomised numbers, e.g.
arr(1) = 4
arr(2) = 1
arr(3) = 3
arr(4) = 2
Your randomised string will now be
mid(name, arr(1), 1) & mid(name(arr(2), 1) & mid(name, arr(3), 1) &
mid(name(arr(4), 1)

You must, of course, automate the process instead of writing it
out as above.


"RICK" <RICK@xxxxxx> wrote in message
news:A9EE9112-5780-4DD3-A2C3-BADBEC32CCCB@xxxxxx
Quote:

> But, my characters are alphanumeric.
>
> What I have done is to create seven random letters followed by one random
> number and one random special character.
>
> I now want to randomize these nine characters into another
>
> "Pegasus (MVP)" wrote:
>
Quote:

>>
>> "RICK" <RICK@xxxxxx> wrote in message
>> news:F73BB2A2-98D0-4BBC-B3E5-2C347A597962@xxxxxx
Quote:

>> >I have a string of of characters that are being stored in a variable. I
>> > would like to randomize those characters. How can I do that?
>> >
>> > Rick
>>
>> If your string contains n characters then you could use the rnd
>> function to generate n integers between 1 and n, making sure
>> that each number is unique. You then use these numbers to
>> rearrange the characters in your string.
>>
>>
>>

My System SpecsSystem Spec