Escape Quotes in Objective-C

后端 未结 4 1988
Happy的楠姐
Happy的楠姐 2020-12-10 16:52

I\'m using this code snippet to encode characters to be friendly with a POST request:

   NSString *unescaped = [textField text];
   NSString *escapedString =         


        
4条回答
  •  甜味超标
    2020-12-10 17:03

    try using \" instead of using " directly...

    Special Characters like Quotes, slashes and others require \ to make that character to remove its special functionality.

提交回复
热议问题