enumValueOf

Returns an enum entry with specified name.

expect inline fun <T : Enum<T>> enumValueOf(name: String): T(source)
enum class Direction { NORTH, SOUTH, EAST, WEST }

fun main() {
    val dirName = "EAST"
    val direction = enumValueOf<Direction>(dirName)
    println(direction) // Output: EAST
}

Source