I want to turn an `Int?` into a `String?` but if t...
# announcements
f
I want to turn an
Int?
into a
String?
but if the
Int?
is
null
I don't want to have a literal
"null"
String, I want the string value to be
null
. Is there an operator for this or do I have to check it manually?
a
Copy code
null?.toString() == null
f
that expression doesn't turn an Int into a String
a
image.png
☝🏼 1
d
Copy code
val num: Int? = ...
num?.toString()
f
oh thank you
my mistake was somewhere else
I called
toString()
on that nullable String instead of
orEmpty()
👍 1