Html格式 文本输出(删除制表符)

Html格式 文本输出(删除制表符)_第1张图片
Screenshot 2017-04-24_14-15-32.png
NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    NSCharacterSet *controlChars = [NSCharacterSet controlCharacterSet];
    NSRange range = [responseString rangeOfCharacterFromSet:controlChars];
    if (range.location != NSNotFound)
    {
        NSMutableString *mutable = [NSMutableString stringWithString:responseString];
        while (range.location != NSNotFound)
        {
            [mutable deleteCharactersInRange:range];
            range = [mutable rangeOfCharacterFromSet:controlChars];
        }
        responseString = mutable;
    }
data = [responseString dataUsingEncoding:NSUTF8StringEncoding];

选择并删除其中的制表符,转化为UTF-8格式数据

你可能感兴趣的:(Html格式 文本输出(删除制表符))