title: JSON getString() removes spaces from string?
body: <p>I have the following JSON data :</p>
  
  <pre><code>{
      "customer": [
          {
              "cus_name": "ravi sharma",
              "cus_email": "sk@yahoo.com",
              "cus_pass": "pass",
              "cus_mob": "91111111",
              "cus_add": "new delhi India",
              "cus_pass_reset_ques": "What is your lucky no.?",
              "cus_pass_reset_ans": "987"
          }
      ]
  }
  </code></pre>
  
  <p>When I try to get <code>cus_pass_reset_ques</code> key data from JSON, <code>getString()</code> removes the spaces in string. </p>
  
  <pre><code>try {
  
      JSONArray earthquakes = json.getJSONArray("customer");
  
      for (int i = 0; i &lt; earthquakes.length(); i++) {
          JSONObject e = earthquakes.getJSONObject(i);
  
          String a = e.getString("cus_name");
          String b = e.getString("cus_email");
          String c = e.getString("cus_pass");
          String d = e.getString("cus_mob");
          String h = e.getString("cus_add");
          String f = e.getString("cus_pass_reset_ques");
          String g  = e.getString("cus_pass_reset_ans");                  
  
      }
  } catch (JSONException e) {
      Log.e("log_tag", "Error parsing data " + e.toString());
  }
  </code></pre>
  
  <p>So how can I get the actual data as in above JSON.</p>
  
  <hr>
  
  <p>This problem has been solved, thanks to - <a href="http://www.androidaspect.com/2013/05/android-json-parsing-tutorial.html" rel="nofollow">http://www.androidaspect.com/2013/05/android-json-parsing-tutorial.html</a></p>