How do I shuffle the characters in a string (e.g. hello could be ehlol or lleoh or ...). I don\'t want to use the Collections.shuffle(...) method, is there anyt
Without external libraries, for those who do not mind using Collections.shuffle():
static String shuffle(String string){
List list = string.chars().mapToObj(c -> new Character((char) c))
.collect(Collectors.toList());
Collections.shuffle(list);
StringBuilder sb = new StringBuilder();
list.forEach(c -> sb.append(c));
return sb.toString();
}