StringNumberExtensions extension

An extension on the String class to extract the trailing integer from a string.

This extension provides a method to get the trailing integer from a string. If the string is empty or does not contain a trailing integer, it returns null.

on

Properties

isNumber → bool

Available on String, provided by the StringNumberExtensions extension

Returns true if this string parses as an integer via int.tryParse.
no setter

Methods

getTrailingInt() → int?

Available on String, provided by the StringNumberExtensions extension

Gets the trailing integer from the string.
isNumeric() → bool

Available on String, provided by the StringNumberExtensions extension

Returns true if this string can be parsed as a number. Audited: 2026-06-12 11:26 EDT
toDoubleNullable() → double?

Available on String, provided by the StringNumberExtensions extension

Returns this string parsed as a double, or null if parsing fails.
toIntNullable() → int?

Available on String, provided by the StringNumberExtensions extension

Returns this string parsed as an int, or null if parsing fails. Audited: 2026-06-12 11:26 EDT