Is there a simple way to pad a collection? I.e. "i...
# getting-started
d
Is there a simple way to pad a collection? I.e. "if smaller than n elements, pad with null". Currently I use
(myCollection.asSequence + infiniteNulls).take(n).toList()
where
infiniteNulls
is
buildSequence<T?> { while (true) yield(null) }
.