Sort string by character codes.
String sortedString(String s) { List<int> chars = List.from(s.codeUnits); chars.sort(); return String.fromCharCodes(chars); }