removeWhitespace method

String removeWhitespace()

Removes all whitespace characters from the string.

Example:

'hello world'.removeWhitespace(); // 'helloworld'
'  test  '.removeWhitespace(); // 'test'

Implementation

String removeWhitespace() => replaceAll(RegExp(r'\s+'), '');