partition
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
inline fun CharSequence.partition(
predicate: (Char) -> Boolean
): Pair<CharSequence, CharSequence>
Splits the original char sequence into pair of char sequences, where first char sequence contains characters for which predicate yielded true
, while second char sequence contains characters for which predicate yielded false
.
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
inline fun String.partition(
predicate: (Char) -> Boolean
): Pair<String, String>
Splits the original string into pair of strings, where first string contains characters for which predicate yielded true
, while second string contains characters for which predicate yielded false
.