Replace tab in NSString with \t

后端 未结 1 1143
一整个雨季
一整个雨季 2021-01-21 20:40

I\'m parsing json with SBJson.
I receive an error \"-JSONValue failed. Error is: Unescaped control character [0x09]\" when parsing my json string, it has unencoded tab. How

相关标签:
1条回答
  • 2021-01-21 21:17

    You can use stringByReplacingOccurrencesOfString:withString::

    NSString * newJsonString = [oldJsonString stringByReplacingOccurrencesOfString:@"\t" withString:@"\\t"];
    
    0 讨论(0)
提交回复
热议问题