I'm trying to scramble a String and I have it working, I was just wondering if there is a more efficient way of doing it than what I have. Does anyone have a suggestion on how to make this more efficient?
String abc = "abcdefghijklmnopqrstuvwxyz";
String scrambled = "";
Random randGen = new Random();
while(scrambled.length() != abc.length())
char rand = abc.charAt(randGen.nextInt(abc.length()));
if(!scrambled.contains("" + rand))
scrambled += rand;