init(validatingCString:)
Creates a new string by copying and validating the null-terminated UTF-8 data referenced by the given array.
Declaration
init?(validatingCString nullTerminatedUTF8: [CChar])Parameters
- nullTerminatedUTF8:
An array containing a null-terminated sequence of UTF-8 code units.
Discussion
This initializer does not try to repair ill-formed UTF-8 code unit sequences. If any are found, the result of the initializer is nil.