-(NSString *)changeToSBCCode:(NSString *)aSBCCodeString{
//65248
// aSBCCodeString = @"ABCDEAaa";//65313-65338 65,97 65345
NSLog(@"转换前%@",aSBCCodeString);
NSMutableString *tResult = [NSMutableString stringWithUTF8String:""];
for (NSInteger tIndex = 0; tIndex< aSBCCodeString.length; tIndex++) {
unichar tChar = [aSBCCodeString characterAtIndex:tIndex];
if (tChar >65248) {
tChar -=65248;
}
[tResult appendString:[NSString stringWithFormat:@"%c",tChar]];
}
NSLog(@"转换后%@",tResult);
return tResult;
}
iOS 适用于大写英文的全角转半角
最新推荐文章于 2021-08-30 11:09:47 发布