Kotlin Katas 👷🏼♂️👷🏼♀️
Get ASCII value of character
My approach
fun getAscii(c: Char): Int {
return c.toInt()
}
Other approaches
val getAscii = Char::toInt
fun getAscii(c: Char) = c.toInt()
fun getAscii(c: Char): Int = c.toInt()
fun getAscii(c: Char): Int {
return c.toInt()
}
val getAscii = Char::toInt
fun getAscii(c: Char) = c.toInt()
fun getAscii(c: Char): Int = c.toInt()