scala - How to match multiple condition in if else - Stack ...
stackoverflow.com › questions › 61626738May 6, 2020 · How to match multiple condition in if else. I have 3 variables like below, and I want the result as first priority is return x, if x is blank then return y, if x and y both blank then return z. below is my code, but this is not working. val x = "1" val y = "2" val z = "3" val result = { var res = " if (x == "") y else x else if (y == "") z } For result First priority is to x and if x = "" then y, if y also "" then return z.