---
title: "isSurrogate(_:)"
framework: swift
role: symbol
role_heading: Type Method
path: "swift/unicode/utf16/issurrogate(_:)"
---

# isSurrogate(_:)

Returns a Boolean value indicating whether the specified code unit is a high or low surrogate code unit.

## Declaration

```swift
static func isSurrogate(_ x: Unicode.UTF16.CodeUnit) -> Bool
```
