asInteger

fun asInteger(defaultValue: Int = 0): Int

Attempts to convert and return the value of this instance as an integer. If the conversion is invalid, the default value is returned.

Return

The value of this instance as an integer.

Parameters

defaultValue

The default value to return if the conversion is invalid.