How to use null safety operator within a when branch in kotlin?
I have written a logic as shown below
fun snippet(value: String?): String {
when (value?.toUpperCase()) {
"A" -> "A"
"B" -> "B"
else -> ""
}
}
Will it return "" when the value of the variable value is null?