---
title: "utf16Offset(in:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/string/index/utf16offset(in:)"
---

# utf16Offset(in:)

The UTF-16 code unit offset corresponding to this index.

## Declaration

```swift
func utf16Offset<S>(in s: S) -> Int where S : StringProtocol
```
