padStart

inline fun <T> Sequence<T>.padStart(size: Int, padBlock: (Int) -> T): Sequence<T>(source)

Pads this sequence at the start to the specified size. New elements are generated using padBlock, which receives the current size as a parameter.

Return

A sequence padded to at least the specified size

Parameters

size

The target size of the padded sequence

padBlock

A function that generates padding elements based on the current sequence size

Type Parameters

T

The type of elements in the sequence


inline fun <T> Sequence<T>.padStart(size: Int, o: T): Sequence<T>(source)

Pads this sequence at the start to the specified size using the given element o.

Return

A sequence padded to at least the specified size

Parameters

size

The target size of the padded sequence

o

The element to use for padding

Type Parameters

T

The type of elements in the sequence


inline fun <T> List<T>.padStart(size: Int, padBlock: (Int) -> T): List<T>(source)

Pads this list at the start to the specified size. New elements are generated using padBlock, which receives the current size as a parameter.

Return

A list padded to at least the specified size

Parameters

size

The target size of the padded list

padBlock

A function that generates padding elements based on the current list size

Type Parameters

T

The type of elements in the list


inline fun <T> List<T>.padStart(size: Int, o: T): List<T>(source)

Pads this list at the start to the specified size using the given element o.

Return

A list padded to at least the specified size

Parameters

size

The target size of the padded list

o

The element to use for padding

Type Parameters

T

The type of elements in the list