IntExtensions extension

IntExtensions is an extension on the int class in Dart. It provides additional methods for performing operations on integers.

The methods in this extension include, but are not limited to, methods for counting the number of digits in an integer.

Example usage:

int count = 12345.countDigits();  // returns 5

Note: All methods in this extension are null-safe, meaning they will not throw an exception if the integer on which they are called is null.

on

Methods

countDigits() int

Available on int, provided by the IntExtensions extension

This function counts the number of digits in an integer. It takes an integer as input and returns the number of digits in the integer.
forceBetween(int from, int to) int

Available on int, provided by the IntExtensions extension

Ensure NOT this greater than or equal to from and less than or equal to to?