Skip to content

Commit 33a1bac

Browse files
committed
Fixes example snippets in StringUTF8View.swift
1 parent b121ce9 commit 33a1bac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/StringUTF8View.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ extension String {
7878
///
7979
/// print(strncmp(s1, s2, 14))
8080
/// // Prints "0"
81-
/// print(String(s1.utf8.prefix(14)))
81+
/// print(String(s1.utf8.prefix(14))!)
8282
/// // Prints "They call me '"
8383
///
8484
/// Extending the compared character count to 15 includes the differing
8585
/// characters, so a nonzero result is returned.
8686
///
8787
/// print(strncmp(s1, s2, 15))
8888
/// // Prints "-17"
89-
/// print(String(s1.utf8.prefix(15)))
89+
/// print(String(s1.utf8.prefix(15))!)
9090
/// // Prints "They call me 'B"
9191
@frozen
9292
public struct UTF8View {

0 commit comments

Comments
 (0)