StdLib: Rename method parameters (Strings)

This commit is contained in:
Ilya Gorbunov
2015-11-18 18:19:58 +03:00
parent bbe6a3c7ca
commit 7e7a55bbe4
5 changed files with 60 additions and 58 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ public fun String.splitWithRegex(regex: String): Array<String> = noImpl
@library("splitString")
public fun String.splitWithRegex(regex: String, limit: Int): Array<String> = noImpl
@native public fun String.substring(beginIndex : Int) : String = noImpl
@native public fun String.substring(beginIndex : Int, endIndex : Int) : String = noImpl
@native public fun String.substring(startIndex : Int) : String = noImpl
@native public fun String.substring(startIndex : Int, endIndex : Int) : String = noImpl
@native public fun String.concat(str : String) : String = noImpl
+8 -8
View File
@@ -17,13 +17,13 @@ public fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boole
}
/**
* Returns `true` if a substring of this string starting at the specified offset [thisOffset] starts with the specified prefix.
* Returns `true` if a substring of this string starting at the specified offset [startIndex] starts with the specified prefix.
*/
public fun String.startsWith(prefix: String, thisOffset: Int, ignoreCase: Boolean = false): Boolean {
public fun String.startsWith(prefix: String, startIndex: Int, ignoreCase: Boolean = false): Boolean {
if (!ignoreCase)
return nativeStartsWith(prefix, thisOffset)
return nativeStartsWith(prefix, startIndex)
else
return regionMatches(thisOffset, prefix, 0, prefix.length(), ignoreCase)
return regionMatches(startIndex, prefix, 0, prefix.length(), ignoreCase)
}
/**
@@ -45,13 +45,13 @@ public inline fun String.matches(regex : String) : Boolean {
public fun CharSequence.isBlank(): Boolean = length() == 0 || (if (this is String) this else this.toString()).matches("^[\\s\\xA0]+$")
public fun String?.equals(anotherString: String?, ignoreCase: Boolean = false): Boolean =
public fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean =
if (this == null)
anotherString == null
other == null
else if (!ignoreCase)
this == anotherString
this == other
else
anotherString != null && this.toLowerCase() == anotherString.toLowerCase()
other != null && this.toLowerCase() == other.toLowerCase()
public fun CharSequence.regionMatches(thisOffset: Int, other: CharSequence, otherOffset: Int, length: Int, ignoreCase: Boolean = false): Boolean