rtrim method

String rtrim()

trims trailing whitespace

Implementation

String rtrim() {
  return replaceFirst(RegExp(r'\s+$'), '');
}