I want to use let
to check two conditions
Lets say if I had to use if
then this is the condition
if (it.data != null && !it.data!!.name.isEmpty()) {}
How can I convert it to use let
I know that to check null this is what we do
it.data?.let {}
but I don't know how to check the second part which is if a string is empty or not. Please keep in mind that I have to check that data
is not null AND data.name
is not empty
Any help will be highly appreciated
it.data?.let {mData-> if (mData.name.isEmpty()) {} }