I have an enum with some instances Foo and Bar. If I have a string \"Foo\", how can I instantiate a Foo enum from that?
Foo
Bar
\"Foo\"
Would do it like
enum class MyEnum { Foo, Bar, Baz } val value = MyEnum.values().firstOrNull {it.name == "Foo"} // results to MyEnum.Foo