toShort

Parses the string to a Short number.

expect fun String.toShort(): Short(source)
val str = "42"
val shortVal: Short = str.toShort()
println(shortVal)   // prints 42

Source