Type Method

string(withCString:length:)

Returns a string containing the characters in a given C-string.

Declaration

class func string(withCString bytes: UnsafePointer<Int8>, length: Int) -> Any?

Discussion

cString must not be NULL. cString should contain characters in the default C-string encoding. This method converts length * sizeof(char) bytes from cString and doesn’t stop short at a NULL character.

See Also

Related Symbols

stringWithCString:encoding:

Returns a string containing the bytes in a given C array, interpreted according to a given encoding.