jeudi 14 avril 2016

How do you switch two random letters in a string in java?

I'm looking to switch 2 random characters in a string. For example, if I start with "abcdef", I'd like the computer to generate 2 random numbers, and switch 2 characters. So a possible outcome could be "afcdeb".




Aucun commentaire:

Enregistrer un commentaire