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

# index(before:)

Returns the position immediately before the given index.

## Declaration

```swift
func index(before idx: String.UTF16View.Index) -> String.UTF16View.Index
```

## Return Value

Return Value The index value immediately before i.
