This line of code does not produce the result I am expecting.
NSString *tmpstoryTitle2 = [tmpstoryTitle stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
I am attempting to change a string like this:
hello, "this" is my string.
to
hello, \"this\" is my string.
With the code above. However, the output I get is:
hello, \\"this\\" is my string.
If I remove the \\ from the search string \\" to replace \" I get the output:
hello, "this" is my string.
Which is right, but I am unable to add the \ infront of my " with the escape sequence, \\ for backslash and \" for double quotes.