digitsBetween method
Get the digits between start
and end
in the number
Returns the digits between start
and end
in the number
Implementation
num digitsBetween(num start, num end) {
var startIndex = toString().indexOf(start.toString());
if (startIndex == -1) return 0;
var endIndex = toString().indexOf(end.toString(), startIndex + 1);
if (endIndex == -1) return 0;
var result = toString().substring(startIndex + 1, endIndex);
return int.parse(result);
}