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

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.
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.