---
title: "removeLast(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/outputrawspan/removelast(_:)"
---

# removeLast(_:)

Remove the last N elements, returning the memory they occupy to the uninitialized state.

## Declaration

```swift
mutating func removeLast(_ k: Int)
```

## Discussion

Discussion n must not be greater than count
