---
title: "index(before:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/string/unicodescalarview/index(before:)"
---

# index(before:)

Returns the previous consecutive location before i.

## Declaration

```swift
func index(before i: String.UnicodeScalarView.Index) -> String.UnicodeScalarView.Index
```

## Discussion

Discussion note: The previous location exists.
