mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fixes example snippets in CString.swift (#31407)
* Fixes example snippets in CString.swift * Fixes example snippet in CString.swift
This commit is contained in:
@@ -76,7 +76,7 @@ extension String {
|
||||
/// let s = String(validatingUTF8: ptr.baseAddress!)
|
||||
/// print(s)
|
||||
/// }
|
||||
/// // Prints "Optional(Café)"
|
||||
/// // Prints "Optional("Café")"
|
||||
///
|
||||
/// let invalidUTF8: [CChar] = [67, 97, 102, -61, 0]
|
||||
/// invalidUTF8.withUnsafeBufferPointer { ptr in
|
||||
@@ -114,7 +114,7 @@ extension String {
|
||||
/// repairingInvalidCodeUnits: true)
|
||||
/// print(s)
|
||||
/// }
|
||||
/// // Prints "Optional((Café, false))"
|
||||
/// // Prints "Optional((result: "Café", repairsMade: false))"
|
||||
///
|
||||
/// let invalidUTF8: [UInt8] = [67, 97, 102, 195, 0]
|
||||
/// invalidUTF8.withUnsafeBufferPointer { ptr in
|
||||
@@ -123,7 +123,7 @@ extension String {
|
||||
/// repairingInvalidCodeUnits: true)
|
||||
/// print(s)
|
||||
/// }
|
||||
/// // Prints "Optional((Caf<EFBFBD>, true))"
|
||||
/// // Prints "Optional((result: "Caf<EFBFBD>", repairsMade: true))"
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - cString: A pointer to a null-terminated code sequence encoded in
|
||||
|
||||
Reference in New Issue
Block a user