Deprecate size and length property on CharSequence.
This commit is contained in:
@@ -175,3 +175,8 @@ public val Map<*, *>.empty: Boolean
|
||||
deprecated("Use isNotEmpty() function call instead")
|
||||
public val Collection<*>.notEmpty: Boolean
|
||||
get() = isNotEmpty()
|
||||
|
||||
deprecated("Use length() instead")
|
||||
public val CharSequence.length: Int
|
||||
get() = length()
|
||||
|
||||
|
||||
@@ -42,3 +42,7 @@ deprecated("Use length() instead")
|
||||
public val String.size: Int
|
||||
get() = length()
|
||||
|
||||
deprecated("Use length() instead")
|
||||
public val CharSequence.size: Int
|
||||
get() = length()
|
||||
|
||||
|
||||
@@ -64,9 +64,6 @@ public fun String?.orEmpty(): String = this ?: ""
|
||||
public val String.indices: IntRange
|
||||
get() = 0..length() - 1
|
||||
|
||||
public val CharSequence.length: Int
|
||||
get() = length()
|
||||
|
||||
public fun CharSequence.get(index: Int): Char = this.charAt(index)
|
||||
|
||||
/**
|
||||
|
||||
@@ -119,9 +119,6 @@ public fun String.toLowerCase(locale: java.util.Locale): String = (this as java.
|
||||
|
||||
public fun String.toUpperCase(locale: java.util.Locale): String = (this as java.lang.String).toUpperCase(locale)
|
||||
|
||||
public val CharSequence.size: Int
|
||||
get() = this.length
|
||||
|
||||
public fun String.toBoolean(): Boolean = java.lang.Boolean.parseBoolean(this)
|
||||
public fun String.toShort(): Short = java.lang.Short.parseShort(this)
|
||||
public fun String.toInt(): Int = java.lang.Integer.parseInt(this)
|
||||
|
||||
Reference in New Issue
Block a user