标签:
1.汉字转拼音
func pinYinZChines(content:String)->String{
let transformContents = CFStringCreateMutableCopy(
nil
, 0, content)
CFStringTransform( transformContents,
nil
, kCFStringTransformMandarinLatin,
false
)
CFStringTransform( transformContents,
nil
, kCFStringTransformStripDiacritics,
false
)
let ztransformContents = transformContents as String
let index = ztransformContents.startIndex.advancedBy(0)
let firstString = ztransformContents[index]
let stringZ = String.init(firstString)
return
stringZ.uppercaseString
}
标签:
原文地址:http://www.cnblogs.com/starainDou/p/5901860.html