title: Use JsonConvert.DeserializeObject when input string isn't valid Json and is or starts with a number
body: <p>I want to find a good solution to handle deserializing plain strings that starts with a number or contains only a number, and understand why it doesn't work as it is now.</p>
  
  <p>I can't control the input strings so I can't rely on them being valid Json, and at the moment I'm just checking if it is Json and if it isn't I'll wrap it in "[{}]", but I wanted to see if there was a better way.</p>
  
  <p>This is how I'm deserializing it:</p>
  
  <pre><code>JsonConvert.DeserializeObject&lt;MyClass[]&gt;(myString);
  </code></pre>
  
  <p>My class has two properties:</p>
  
  <pre><code>[JsonProperty(PropertyName = "key")]
  public string Key { get; set; }
  
  [JsonProperty(PropertyName = "value")]
  public string Value { get; set; }
  </code></pre>
  
  <p>If the input string is just "a" or "a2" it throws a Newtonsoft.Json.JsonException ("Unexpected character encountered while parsing value: a. Path '', line 0, position 0.") which is expected, however "2" and "2a" throws other errors. I'd like the same behavior for "2" and "2a" as for "a" and "a2".</p>
  
  <p>Exception when passing in "2":</p>
  
  <pre><code>Newtonsoft.Json.JsonSerializationException : Error converting value 2 to type 'MyClass[]'. Path '', line 1, position 1.
  System.ArgumentException : Could not cast or convert from System.Int64 to MyClass[].
  </code></pre>
  
  <p>Exception when passing in "2a":</p>
  
  <pre><code>System.FormatException : Input string was not in a correct format.
  </code></pre>
  
  <p>Why doesn't it work when the string contains only numbers or starts with a number? Is there a smarter way to fix this than to wrap the input string with "[{}]"?</p>