In Swift, the char array is joined as UnsafePointer<Int8> . Character access works the same in Swift for NSString :
let str: NSString = "hello" let charStr = str.UTF8String
For the Swift String object, everything is a little different:
let str = "hello" let charStr = str.cStringUsingEncoding(NSUTF8StringEncoding)
charStr [CChar]? where CChar is typeailais for Int8 .
JAL Mar 18 '16 at 19:13 2016-03-18 19:13
source share