+ (int)convertToInt:(NSString*)strtemp
{
int strLength = 0;
char *p = (char *)[strtemp cStringUsingEncoding:NSUnicodeStringEncoding];
int length = [strtemp lengthOfBytesUsingEncoding:NSUnicodeStringEncoding];
for (int i = 0; i < length; i ++) {
if (*p) {
p ++;
strLength ++;
}else{
p ++;
}
}
return (strLength+1)/2;
}
时间: 2024-10-02 02:10:00