Kotlin Program to Compare Strings

Kotlin Program to Compare Strings. Compares this object with the specified object for order. Returns zero if this object is equal to the specified another object, a negative number if it’s less than other, or a positive number if it’s greater than other.

Kotlin Program to Compare Strings

Source Code

fun main(args: Array<String>) {

    val style = "Bold"
    val style2 = "Bold"

    if (style == style2)
        println("Equal(=)")
    else
        println("Not Equal")
}

Output