在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
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
} |
请发表评论