---
title: isContiguousUTF8
framework: swift
role: symbol
role_heading: Instance Property
path: swift/substring/iscontiguousutf8
---

# isContiguousUTF8

Returns whether this string’s storage contains validly-encoded UTF-8 contents in contiguous memory.

## Declaration

```swift
var isContiguousUTF8: Bool { get }
```

## Discussion

Discussion Contiguous strings always operate in O(1) time for withUTF8, always give a result for Substring.UTF8View.withContiguousStorageIfAvailable, and always return a non-nil value from Substring._utf8Span and Substring.UTF8View._span. Contiguous strings also benefit from fast-paths and better optimizations.
