commonMain.com.copperleaf.json.utils.listUtils.kt Maven / Gradle / Ivy
package com.copperleaf.json.utils
public fun List.takeHead(): Pair> {
return this.first() to this.drop(1)
}
public inline fun List.takeHead(mapHead: (T) -> U): Pair> {
return mapHead(this.first()) to this.drop(1)
}
public fun List.takeHead(numberOfHeadElements: Int): Pair, List> {
return this.take(numberOfHeadElements) to this.drop(numberOfHeadElements)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy