normalizeWhitespace method

String normalizeWhitespace()

Replace all white-space sequences with single space and trim.

Implementation

String normalizeWhitespace() => replaceAll(RegExp(r'(\s{2,})'), ' ').trim();