For example:
let array = ["1234","5678"]
this array of values should be converted to the following string -
"[\"1234\",\"5678\"]"
Although I found answer here - Objective-C - How to convert NSString to escaped JSON string? but it doesn't look clean. Is there some cleaner way to do this ?
I am able to get this output - "["one","two"]" using
NSJSONSerialization.dataWithJSONObject
but how to have backslashes in between of strings?