title: A JSONObject text must begin with '{' error
body: <p>I have this JSON coming from one of our REST service:</p>
  
  <pre><code>[
      "{\"category_name\":[\"Industry Components\"],\"categoryId\":[1]}",
      "{\"category_name\":[\"Business Components\"],\"categoryId\":[2]}",
      "{\"category_name\":[\"Utilities\"],\"categoryId\":[3]}",
      "{\"category_name\":[\"Tools\"],\"categoryId\":[4]}
  ]
  </code></pre>
  
  <p>I am using java-json.jar to parse this JSON, this is the simple snippet where I am trying to pass above JSON string:</p>
  
  <pre><code>JSONObject jsonObject = new JSONObject(jsonStr);
  </code></pre>
  
  <p>But I am getting below exception:</p>
  
  <pre><code>org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
  </code></pre>
  
  <p>First I assumed it's because of <code>[</code> and <code>]</code> characters in JSON and I tried to replace as below:</p>
  
  <pre><code>String replacedStr = jsonStr.replaceAll("\\[", "").replaceAll("\\]", "")
  </code></pre>
  
  <p>But even then I am getting same exception. Can anyone please guide me to know what I am doing wrong?</p>