No overview available.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 10.2+
Framework
- Foundation
No overview available.
SDKs
Framework
init?(bytes No Copy: Unsafe Mutable Raw Pointer, length: Int, encoding: String .Encoding, free When Done: Bool)
Produces an initialized String
object that contains a given number of bytes from a given buffer of bytes interpreted in a given encoding, and optionally frees the buffer. WARNING: this initializer is not memory-safe!
init(c String: Unsafe Pointer<CChar>)
Creates a new string by copying the null-terminated UTF-8 data referenced by the given pointer.
init(c String: Unsafe Pointer<UInt8>)
Creates a new string by copying the null-terminated UTF-8 data referenced by the given pointer.
init?(c String: Unsafe Pointer<CChar>, encoding: String .Encoding)
Produces a string containing the bytes in a given C array, interpreted according to a given encoding.
init<Encoding>(decoding CString: Unsafe Pointer<Encoding .Code Unit>, as: Encoding .Type)
Creates a string from the null-terminated sequence of bytes at the given pointer.
static func decode CString<Encoding>(Unsafe Pointer<Encoding .Code Unit>?, as: Encoding .Type, repairing Invalid Code Units: Bool) -> (result: String, repairs Made: Bool)?
Creates a new string by copying the null-terminated data referenced by the given pointer using the specified encoding.