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

Checks if the string can be parsed as a number.
toDoubleNullable() double?

Available on String, provided by the StringNumberExtensions extension

safely get an double from a string
toIntNullable() int?

Available on String, provided by the StringNumberExtensions extension

safely get an int from a String