toIntOrDefault

fun String.toIntOrDefault(default: Int): Int

Parses this string as a decimal Int, returning default when it is not a valid integer.