File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,17 @@ extension String.UTF8View {
319
319
320
320
extension String . UTF8View {
321
321
322
+ /// A span over the UTF8 code units that make up this string.
323
+ ///
324
+ /// - Note: In the case of bridged UTF16 String instances (on Apple
325
+ /// platforms,) this property transcodes the code units the first time
326
+ /// it is called. The transcoded buffer is cached, and subsequent calls
327
+ /// to `span` can reuse the buffer.
328
+ ///
329
+ /// Returns: a `Span` over the UTF8 code units of this String.
330
+ ///
331
+ /// Complexity: O(1) for native UTF8 Strings,
332
+ /// amortized O(1) for bridged UTF16 Strings.
322
333
@available ( SwiftStdlib 6 . 2 , * )
323
334
public var span : Span < UTF8 . CodeUnit > {
324
335
@lifetime ( borrow self)
You can’t perform that action at this time.
0 commit comments