Kotlin Conditional Statements Standard if-statement


Example

val str = "Hello!"
if (str.length == 0) {
    print("The string is empty!")
} else if (str.length > 5) {
    print("The string is short!")
} else {
    print("The string is long!")
}

The else-branches are optional in normal if-statements.