January 2018
Intermediate to advanced
434 pages
14h 1m
English
The partition function works in a similar way with arrays as well. Here are its different usages. Each of them works similarly, just producing lists of different types:
// Produces two listsinline fun <T> Array<out T>.partition( predicate: (T) -> Boolean ): Pair<List<T>, List<T>>
// Breaks original list of Byte and produces two lists of Byteinline fun ByteArray.partition( predicate: (Byte) -> Boolean ): Pair<List<Byte>, List<Byte>>
// Breaks original list of Short and produces two lists of Shortinline fun ShortArray.partition( predicate: (Short) -> Boolean ): Pair<List<Short>, List<Short>>
// Breaks original list of Int and produces two lists of Intinline fun IntArray.partition( predicate: (Int) -> Boolean ): Pair<List<Int
Read now
Unlock full access