[stdlib] Use more idiomatic and performant implementation of isBlank
Also replace expect-actual with a common function because its implementation is no longer different in different platforms. KT-65590
This commit is contained in:
committed by
Space Team
parent
6f6496d78a
commit
15375c0fd5
@@ -614,13 +614,6 @@ public actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase:
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun String.intern(): String = (this as java.lang.String).intern()
|
||||
|
||||
/**
|
||||
* Returns `true` if this string is empty or consists solely of whitespace characters.
|
||||
*
|
||||
* @sample samples.text.Strings.stringIsBlank
|
||||
*/
|
||||
public actual fun CharSequence.isBlank(): Boolean = length == 0 || indices.all { this[it].isWhitespace() }
|
||||
|
||||
/**
|
||||
* Returns the index within this string that is offset from the given [index] by [codePointOffset] code points.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user