isContiguousUTF8
Returns whether this string’s storage contains validly-encoded UTF-8 contents in contiguous memory.
Declaration
var isContiguousUTF8: Bool { get }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.