extractId method

int extractId()

Implementation

int extractId() {
  if (this == null) return 0;
  var numberMatch = new RegExp(r'[0-9]+').firstMatch('$this');
  if (numberMatch == null) return 0;
  return int.parse('$this'.substring(numberMatch.start, numberMatch.end));
}