Add support for CASE_INSENSITIVE_ORDER in JS and common

#KT-18067
This commit is contained in:
Ilya Gorbunov
2018-08-12 04:08:05 +03:00
parent 6866f5d19a
commit ed53983e1e
5 changed files with 25 additions and 7 deletions
+8 -1
View File
@@ -105,4 +105,11 @@ public actual fun String.compareTo(other: String, ignoreCase: Boolean = false):
} else {
return compareTo(other)
}
}
}
private val STRING_CASE_INSENSITIVE_ORDER = Comparator<String> { a, b -> a.compareTo(b, ignoreCase = true) }
@SinceKotlin("1.2")
public actual val String.Companion.CASE_INSENSITIVE_ORDER: Comparator<String>
get() = STRING_CASE_INSENSITIVE_ORDER