getNthReverse method

String getNthReverse(
  1. dynamic number,
  2. dynamic limit
)

Implementation

String getNthReverse(number, limit) {
  number = '$number';

  var finalNumber = "";
  var x = 1;
  while (x != limit) {
    finalNumber = number[number.length - x] + finalNumber;
    x++;
  }

  return finalNumber;
}