title: Convert plain string to JSON and back in Swift
body: <p>Let's say there's a JSON-string I got from server: <strong>"\"3\""</strong> (with quotes, i.e. length == 3 here)</p>
  
  <p>In Android-world, I can do:</p>
  
  <p><code>gson.fromJson(json, new TypeToken&lt;String&gt;() {}.getType());</code> - it returns  <strong>"3"</strong> (i.e. length == 1)</p>
  
  <p>In C#-world, can use NewtonSoft.Json:</p>
  
  <p><code>JsonConvert.DeserializeObject&lt;string&gt;(json, settings)</code> - it returns <strong>"3"</strong> (i.e. length == 1)</p>
  
  <p>And other way around, I do have string I want to serialize as a JSON.
  In Android I'd do <code>gson.toJson("\"3\"")</code> and in C# - <code>JsonConvert.SerializeObject("\"3\"")</code></p>
  
  <p>The problem with JSONSerialization is that it doesn't treat plain string as a valid JSON: <code>JSONSerialization.isValidJSONObject("\"3\"") == *false*</code></p>
  
  <p><strong>What would be equivalent in Swift / Obj-C world?</strong></p>
  
  <p>The ugly <strong>workaround</strong> I've found (except of just adding/removing quotes) so far is to wrap string into 1-item-array to make <code>JSONSerialization</code> happy and then remove "[","]" from resulted JSON-string (and other way around - add "[", "]" before deserialization), but it's a way too disgusting to be the  real solution for this problem.</p>