NSDATA转NSSTRING 去掉 <>和空格
-(NSString *)ConvertToNSString:(NSData *)data
{
NSMutableString *strTemp = [NSMutableString stringWithCapacity:[data length]*2];
const unsigned char *szBuffer = [data bytes];
for (NSInteger i=0; i < [data length]; ++i) {
[strTemp appendFormat:@"%02lx",(unsigned long)szBuffer[i]];
}
return strTemp;
}
{
NSMutableString *strTemp = [NSMutableString stringWithCapacity:[data length]*2];
const unsigned char *szBuffer = [data bytes];
for (NSInteger i=0; i < [data length]; ++i) {
[strTemp appendFormat:@"%02lx",(unsigned long)szBuffer[i]];
}
return strTemp;
}