---
title: "formIndex(before:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/array/formindex(before:)"
---

# formIndex(before:)

Replaces the given index with its predecessor.

## Declaration

```swift
func formIndex(before i: inout Int)
```

## Parameters

- `i`: A valid index of the collection. i must be greater than startIndex.

## See Also

### Manipulating Indices

- [startIndex](swift/array/startindex.md)
- [endIndex](swift/array/endindex.md)
- [index(after:)](swift/array/index(after:).md)
- [formIndex(after:)](swift/array/formindex(after:).md)
- [index(before:)](swift/array/index(before:).md)
- [index(_:offsetBy:)](swift/array/index(_:offsetby:).md)
- [formIndex(_:offsetBy:)](swift/array/formindex(_:offsetby:).md)
- [index(_:offsetBy:limitedBy:)](swift/array/index(_:offsetby:limitedby:).md)
- [formIndex(_:offsetBy:limitedBy:)](swift/array/formindex(_:offsetby:limitedby:).md)
- [distance(from:to:)](swift/array/distance(from:to:).md)
