Initializer

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<Int8>, 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

Related Symbols

init?(cString: UnsafePointer<Int8>, encoding: UInt)

Returns an NSString object initialized using the characters in a given C array, interpreted according to a given encoding.