kotlin-stdlib / kotlin.text / compareTo compareTo Common JVM JS 1.0 fun String.compareTo( other: String, ignoreCase: Boolean = false): Int Native 1.3 fun String.compareTo(other: String, ignoreCase: Boolean): Int Compares two strings lexicographically, optionally ignoring case differences.