79112250

Date: 2024-10-22 02:30:24
Score: 1
Natty:
Report link

here is a inline example using when()

val testBoolean = true;
val converted = when(testBoolean){true->1; false->0}
println("This Boolean to Int = $converted")
println("This Boolean to String ${ when(testBoolean){true->"ON"; false->"OFF"} }")
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: semafxtom