Instance Method

removeFirst()

Removes and returns the first element of the collection.

Declaration

@discardableResult mutating func removeFirst() -> Self.Element
Available when Self is SubSequence.

Return Value

The first element of the collection.

Discussion

The collection must not be empty.

Complexity: O(1)

See Also

Selecting and Excluding Elements

func popFirst() -> Self.Element?

Removes and returns the first element of the collection.

func removeFirst(Int)

Removes the specified number of elements from the beginning of the collection.