Contents

string(withCString:length:)

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

Declaration

class func string(withCString bytes: UnsafePointer<CChar>, 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

Deprecated