JS stdlib: implement String.compareTo with ignoreCase

#KT-18067 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-08-03 10:25:22 +09:00
committed by Ilya Gorbunov
parent d194893012
commit f05a19aafb
4 changed files with 62 additions and 1 deletions
@@ -317,7 +317,7 @@ public inline fun String.codePointCount(beginIndex: Int, endIndex: Int): Int =
/**
* Compares two strings lexicographically, optionally ignoring case differences.
*/
public fun String.compareTo(other: String, ignoreCase: Boolean = false): Int {
public actual fun String.compareTo(other: String, ignoreCase: Boolean): Int {
if (ignoreCase)
return (this as java.lang.String).compareToIgnoreCase(other)
else