//字符串中的字符长度 - (int)convertToInt:(NSString *)strTemp {
int strLength = 0;
char *p = (char *)[strTemp cStringUsingEncoding:NSUnicodeStringEncoding];
for (int i = 0 ; i < [strTemplengthOfBytesUsingEncoding:NSUnicodeStringEncoding]; i++) {
if (*p) {
p++;
strLength++;
}
else {
p++;
}
}
return strLength;
}
网友评论