Join Slack
Communities
Powered by
"demo" is from <https://kotlinlang.org/docs/refere...
# announcements
c
CFrei
01/13/2020, 2:46 PM
"demo" is from
https://kotlinlang.org/docs/reference/typecasts.html
Can anyone please let me know why "demo2" is not working?
Untitled
e
ESchouten
01/13/2020, 2:48 PM
Demo2 tries to execute print(x.length) regardless if x is string or not, need to put it in an if statement
d
Dominaezzz
01/13/2020, 2:48 PM
What behaviour do you expect in
demo2
if
x
is not a
String
? I think you want
is
->
as
.
c
CFrei
01/13/2020, 2:49 PM
Thanx. That was it. Argh.
Open in Slack
Previous
Next