digitsAfterLast method

num digitsAfterLast(
  1. num substring
)

Get the digits after the last occurrence of substring in the number Returns the digits after the last occurrence of substring in the number

Implementation

num digitsAfterLast(num substring) {
  var index = toString().lastIndexOf(substring.toString());
  if (index == -1) return 0;
  var result = toString().substring(index + 1);
  return int.parse(result);
}