- [[kotlin]] https://kotlinlang.org/docs/typecasts.html
#kotlin #artifact #programming #codesample
if (obj is String) {
print(obj.length)
}if (obj !is String) {
println("Not a string)
} else {
println(obj.length)
}Control flow docu
when (x) {
is Int -> print(x + 1)
is String -> print(x.length + 1)
is IntArray -> print(x.sum())
}