Hey I am using Kotlin’s Enums and I want to have a method on the Enum that returns a String. How do I use the Enum’s own value in a “when” statement? Heres some code
Copy code
enum class Test {
NONE, TT, TTT;
fun test(): String {
when (this) {
TT -> "hi"
else -> "hey"
}
}
}