init(CString:length:)
Initializes the receiver, a newly allocated NSString object, by converting the data in a given C-string from the default C-string encoding into the Unicode character encoding.
Declaration
convenience init?(CString bytes: UnsafePointer<CChar>, length: Int)Discussion
This method converts length * sizeof(char) bytes from cString and doesn’t stop short at a zero character. cString must contain bytes in the default C-string encoding and may not be NULL. Returns an initialized object, which might be different from the original receiver.
See Also
Deprecated
string(withCString:)init(CString:)string(withCString:length:)init(CStringNoCopy:length:freeWhenDone:)string(withContentsOfFile:)init(contentsOfFile:)string(withContentsOf:)init(contentsOfURL:)write(toFile:atomically:)write(to:atomically:)getCharacters(_:)cString()lossyCString()cStringLength()getCString(_:)