rightTrim method

String rightTrim([
  1. String? chars
])

Trims characters from the right side of the string.

Implementation

String rightTrim([String? chars]) => (chars != null)
    ? replaceAll(RegExp('[$chars]+\$'), '')
    : replaceAll(RegExp(r'\s+$'), '');