private fun mPerformDeletion() {
when {
state.mNumber2.isNotBlank() ->
state = state.copy(mNumber2 = state.mNumber2.dropLast(1))
}
}
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
2
Answers
Sorry about that i forgot to mention the "var mNumber2" class as a data class. when i write it " data class " Error is solved.
Your
when
should have a condition inside a bracket()
but you are using{}
.Also
when
is not required for single conditional statements, you can useif
like: