title: remove whitespace from JSON (api response) in javascript
body: <p>I call an api in javascript and capture the response </p>
  
  <pre><code>var response = client.get(serviceURI);
  var result101 = response.getProperty("content");
  </code></pre>
  
  <p>and later parsing the JSON to edit and repost but its throwing parsing error because there are new lines in json response.</p>
  
  <pre><code>var resultJSON = JSON.parse(result101);
  </code></pre>
  
  <p>How can I remove new lines from the response? I have tried </p>
  
  <pre><code>result101 = result101.replace(/(\r\n|\n|\r)/gm,"");
  </code></pre>
  
  <p>but this is not working for me..</p>
  
  <p>EDIT: Part of result101:</p>
  
  <pre><code>   "description": "Hello world.
  Test Description here.. ",
     "forms": [
  </code></pre>