onlyNumbers property

String get onlyNumbers

Returns only the numbers from the String.

Example

String foo = '4*%^55/es4e5523nt1is';
String onyNumbers = foo.onlyNumbers; // returns '455455231'

Implementation

String get onlyNumbers {
  if (isBlank) {
    return blankIfNull;
  }
  return only(numberChars);
}