compareTo

fun String.compareTo(
    other: String,
    ignoreCase: Boolean = false
): Int
(source)

Platform and version requirements: JVM

Compares two strings lexicographically, optionally ignoring case differences.