swift把汉字转换为拼音,并且截取首字母做索引用

var transformContents = CFStringCreateMutableCopy(nil, 0, “咋啊的看到回复阿斯顿发货发哦iasdifas”)
CFStringTransform(transformContents, nil, kCFStringTransformMandarinLatin, 0)
var traStr:String = transformContents as String
let index = advance(traStr.startIndex, 1)
traStr.uppercaseString.substringToIndex(index)