- (int)countTheStrLength:(NSString*)strtemp {
int strlength =0;
char* p = (char*)[strtempcStringUsingEncoding:NSUnicodeStringEncoding];
for(inti=0; i<[strtemplengthOfBytesUsingEncoding:NSUnicodeStringEncoding] ;i++) {
if(*p) {
p++;
strlength++;
}
else{
p++;
}
}
return(strlength+1)/2;
}
网友评论