cStringLength()
Returns the length in char-sized units of the receiver’s C-string representation in the default C-string encoding.
Declaration
func cStringLength() -> IntDiscussion
Raises if the receiver can’t be represented in the default C-string encoding without loss of information. You can also use canBeConverted(to:) to check whether a string can be losslessly converted to the default C-string encoding. If it can’t, use lossyCString() to get a C-string representation with some loss of information, then check its length explicitly using the ANSI function strlen().
See Also
Related Documentation
Deprecated
string(withCString:)init(CString:)string(withCString:length:)init(CString:length:)init(CStringNoCopy:length:freeWhenDone:)string(withContentsOfFile:)init(contentsOfFile:)string(withContentsOf:)init(contentsOfURL:)write(toFile:atomically:)write(to:atomically:)getCharacters(_:)cString()lossyCString()getCString(_:)