How would I shuffle a string or mix up its characters?
JoshuaKing1 (7)

For example, 'text' might turn into 'xtet'
I know how to do an array but nothing else.

You are viewing a single comment. View All
theangryepicbanana (1305)

Try '0587'.chars.shuffle.join. This creates an array with each character in the string, shuffles them, and then joins them together to make a string. (btw if this answered your question, mark this as the best answer)