Skip to content

Instantly share code, notes, and snippets.

@Kirow
Created August 31, 2018 11:57
Show Gist options
  • Save Kirow/cd86c724938f2c313c43380edf2f0596 to your computer and use it in GitHub Desktop.
Save Kirow/cd86c724938f2c313c43380edf2f0596 to your computer and use it in GitHub Desktop.
Convert to NSString for unescaped output
(lldb) po str
“{\n \”userId\”: 1,\n \”id\”: 1,\n \”title\”: \”sunt aut facere repellat provident occaecati excepturi optio reprehenderit\”,\n \”body\”: \”quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto\”\n}”
(lldb) po NSString(string: str)
{
  “userId”: 1,
  “id”: 1,
  “title”: “sunt aut facere repellat provident occaecati excepturi optio reprehenderit”,
  “body”: “quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto”
}

https://medium.com/@borisoks/swift-convert-to-nsstring-for-unescaped-output-7207bb5c6722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment