trimAll method

String trimAll()

Replaces all the unnecessary whitespace in this string with a single space and returns a new one.

Implementation

String trimAll() => trim().replaceAll(RegExp(r'\s+'), ' ');