hexToInt

Parses an Int value from this string using the specified format.

fun String.hexToInt(format: HexFormat = HexFormat.Default): Int(source)
import kotlin.text.hexToInt

fun main() {
    val hexString = "1A3F"
    val intValue = hexString.hexToInt()  // converts hex to decimal Int
    println("Hex $hexString as Int is $intValue")  // prints: Hex 1A3F as Int is 6719
}

Source