For simple check like

```
if (variable != null) {
   doSomething(variable)
}

```

We could change to 

```
variable?.let { doSometing(it) }

```

However for a case with else

```
if (variable != null) {
   doSomething(variable)
} else {
   doOtherThing()
}

```

Is there a way of doing so in a single function? Is there something like either?