From Reliable Ostrich, 3 Months ago, written in Text.
Embed
  1. String mapMe(String s) {
  2.     s = new TreeMap(s.chars()
  3.             .mapToObj(a -> a)
  4.             .collect(
  5.                 Collectors.groupingBy(
  6.                     a -> a%32, Collectors.mapping( (a -> (char)(int)a), Collectors.toList() )
  7.                 )
  8.             )
  9.             ).toString().replace(" ","").replace("=[",":[");
  10.        
  11.     return "["+ s.substring(1,s.length()-1) +"]";
  12. }
  13.