sort static method

String sort(
  1. String s
)

Implementation

static String sort(String s) {
  var words = s.split(RegExp('\\s+'))..sort();
  var joined = words.join(' ');
  return joined.trim();
}