-
Couldn't load subscription status.
- Fork 0
ProtoString shuffle() Method
Seth Clydesdale edited this page Jun 1, 2015
·
2 revisions
Shuffling the characters of a string.
'string'.shuffle(); // returns 'gitsrn'
'javascript'.shuffle(); // returns 'ticaajvsrp'Passing a number as the parameter will shuffle the string n times.
'string'.shuffle(3); // returns 'rgsnit'
'javascript'.shuffle(4); // returns 'vipaartsjc'The shuffle method shuffles the characters of a string, rendering it unreadable. A shuffled string can then be unshuffled with the unshuffle() method, or by continually shuffling a string's characters.
String.shuffle(n);| Parameter | Description |
|---|---|
| n | A number that specifies the number of times a string should be shuffled. Defaults to 1 if left undefined. |
Home • History • ProtoString • Created by Seth Clydesdale