Returns whether this string is capable of providing access to validly-encoded UTF-8 contents in contiguous memory in O(1) time.
SDK
- Xcode 11.0+
Framework
- Swift Standard Library
Declaration
Discussion
Contiguous strings always operate in O(1) time for withUTF8 and always give a result for String.UTF8View.withContiguousStorageIfAvailable. Contiguous strings also benefit from fast-paths and better optimizations.