init(validatingUTF8:)
Creates a new string by copying and validating the null-terminated UTF-8 data referenced by the given array.
Declaration
init?(validatingUTF8 cString: [CChar])Parameters
- cString:
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.