CMutablePointer<CString> to String in swift-language

2 Solutions Collect From Internet About “CMutablePointer<CString> to String in swift-language”

It goes something like:

 var stringValue :CString = ""

 name.withUnsafePointer {p in
      stringValue = p.memory
 }

 return NSString(CString: stringValue)

You can do:

return NSString(UTF8String: name[0])