remove whitespace from JSON (api response) in javascript -
i call api in javascript , capture response
var response = client.get(serviceuri); var result101 = response.getproperty("content");
and later parsing json edit , repost throwing parsing error because there new lines in json response.
var resultjson = json.parse(result101);
how can remove new lines response? have tried
result101 = result101.replace(/(\r\n|\n|\r)/gm,"");
but not working me..
edit: part of result101:
"description": "hello world. test description here.. ", "forms": [
Comments
Post a Comment