---
title: reverse()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/array/reverse()
---

# reverse()

Reverses the elements of the collection in place.

## Declaration

```swift
mutating func reverse()
```

## Discussion

Discussion The following example reverses the elements of an array of characters: var characters: [Character] = ["C", "a", "f", "é"] characters.reverse() print(characters) // Prints "["é", "f", "a", "C"]" note: O(n), where n is the number of elements in the collection.

## See Also

### Reordering an Array’s Elements

- [sort()](swift/array/sort().md)
- [sort(by:)](swift/array/sort(by:).md)
- [sorted()](swift/array/sorted().md)
- [sorted(by:)](swift/array/sorted(by:).md)
- [reversed()](swift/array/reversed().md)
- [shuffle()](swift/array/shuffle().md)
- [shuffle(using:)](swift/array/shuffle(using:).md)
- [shuffled()](swift/array/shuffled().md)
- [shuffled(using:)](swift/array/shuffled(using:).md)
- [partition(by:)](swift/array/partition(by:)-90po8.md)
- [swapAt(_:_:)](swift/array/swapat(_:_:).md)
