removeAllWhiteSpace method

String removeAllWhiteSpace()

Removes all white spaces from the string.

Example:

print("Hello World".removeAllWhiteSpace()); // "HelloWorld"

Implementation

String removeAllWhiteSpace() =>
    !isEmptyOrNull ? this!.replaceAll(RegExp(r'\s+\b|\b\s'), '') : '';