extractNumbers method

String extractNumbers()

Extracts all numbers from the string.

Example:

'Price: \$123.45'.extractNumbers(); // '12345'

Implementation

String extractNumbers() => replaceAll(RegExp(r'[^\d]'), '');