You are currently viewing the GMLscripts.com static mirror. Forum access and script submissions are not available through this mirror.

Invert GMLscripts.com

string_shuffle

string_shuffle(str)
Returns a given string with charactars shuffled.
COPY/// string_shuffle(str)
//
//  Returns a given string with charactars shuffled.
//
//      str         string of text, string
//
/// GMLscripts.com/license
{
    var str,out,len,i;
    str = argument0;
    out = "";
    do {
        len = string_length(str);
        i = floor(random(len))+1;
        out += string_char_at(str,i);
        str = string_delete(str,i,1);
    } until (len <= 1);
    return out;
}

Contributors: xot

GitHub: View · Commits · Blame · Raw