IntStringExtensions extension

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

The ordinal method in this extension returns an ordinal number of String type for any integer.

It handles both positive and negative integers, as well as zero.

Example usage:

int number = 101;
String ordinalNumber = number.ordinal();  // returns '101st'

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

ordinal() String

Available on int, provided by the IntStringExtensions extension

Returns an ordinal number of String type for any integer