kotlin.text.partition

partition

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.

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.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/partition.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部