# How remove curly braces {} from all string of a json

**URL:** <https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522>\
**Category:** ionic-v1\
**Created:** [December 18, 2015, 3:11pm UTC](https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522 "2015-12-18T15:11:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiobalsamo](https://avatars.discourse-cdn.com/v4/letter/f/47e85d/32.png) [@fabiobalsamo](https://forum.ionicframework.com/u/fabiobalsamo)\
**Post date:** [December 18, 2015, 3:11pm UTC](https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522/1 "2015-12-18T15:11:28Z")

</div>

Hi, i’ve a huge JSON that contains data like this

{“caseFolderId”:"{2854EE70-146A-4618-826C-BA33FC807A25}",“caseTaskId”:"{28BE9F56-A7D7-4CA5-B777-A51FF3847236}",“stepName”:“Item details”,“columns”:{“DV\_NAMECL\_POS\_ODA”:“Tieleman Transport BV”,“DV\_MATNR\_TXZ01\_POS\_ODA”:“445811 - EUROPRENE SBR 1500 GUC BOX 1110 P150 - 1”,“F\_StepName”:“Item details”,“DV\_Caseidentifier\_for\_eni\_OdA”:null,“DV\_MENGE\_MEINS\_POS\_ODA”:“20.000 - KG”,“DV\_PEINH\_POS”:“1000 - KG”,“DV\_NETPR\_WAERS\_POS\_ODA”:“1.000 - EUR”,“DV\_EINDT\_ODA”:“2015/11/28”,“DV\_EBELP\_ODA”:“00010”},“DV\_Caseidentifier\_for\_eni\_OdA”:null,“DV\_EBELP\_ODA”:“00010”,“DV\_EINDT\_ODA”:“2015/11/28”,“DV\_MATNR\_TXZ01\_POS\_ODA”:“445811 - EUROPRENE SBR 1500 GUC BOX 1110 P150 - 1”,“DV\_NAMECL\_POS\_ODA”:“Tieleman Transport BV”,“DV\_NETPR\_WAERS\_POS\_ODA”:“1.000 - EUR”,“DV\_PEINH\_POS”:“1000 - KG”,“DV\_MENGE\_MEINS\_POS\_ODA”:“20.000 - KG”}

how can i remove curly braces {} from all string of the json

---

<div class="post-metadata">

**Author:** ![andrewmcgivery](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/andrewmcgivery/32/65523_2.png) [@andrewmcgivery](https://forum.ionicframework.com/u/andrewmcgivery)\
**Post date:** [December 18, 2015, 7:21pm UTC](https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522/2 "2015-12-18T19:21:47Z")

</div>

You could use a regular expression replace:

```
var jsonString = '{"caseFolderId":"{2854EE70-146A-4618-826C-BA33FC807A25}","caseTaskId":"{28BE9F56-A7D7-4CA5-B777-A51FF3847236}","stepName":"Item details","columns":{"DV_NAMECL_POS_ODA":"Tieleman Transport BV","DV_MATNR_TXZ01_POS_ODA":"445811 - EUROPRENE SBR 1500 GUC BOX 1110 P150 - 1","F_StepName":"Item details","DV_Caseidentifier_for_eni_OdA":null,"DV_MENGE_MEINS_POS_ODA":"20.000 - KG","DV_PEINH_POS":"1000 - KG","DV_NETPR_WAERS_POS_ODA":"1.000 - EUR","DV_EINDT_ODA":"2015/11/28","DV_EBELP_ODA":"00010"},"DV_Caseidentifier_for_eni_OdA":null,"DV_EBELP_ODA":"00010","DV_EINDT_ODA":"2015/11/28","DV_MATNR_TXZ01_POS_ODA":"445811 - EUROPRENE SBR 1500 GUC BOX 1110 P150 - 1","DV_NAMECL_POS_ODA":"Tieleman Transport BV","DV_NETPR_WAERS_POS_ODA":"1.000 - EUR","DV_PEINH_POS":"1000 - KG","DV_MENGE_MEINS_POS_ODA":"20.000 - KG"}';
jsonString = jsonString.replace(/("{|}")/gi,'"');
console.log(jsonString);
```

---

<div class="post-metadata">

**Author:** ![fabiobalsamo](https://avatars.discourse-cdn.com/v4/letter/f/47e85d/32.png) [@fabiobalsamo](https://forum.ionicframework.com/u/fabiobalsamo)\
**Post date:** [December 21, 2015, 8:12am UTC](https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522/3 "2015-12-21T08:12:57Z")

</div>

thank you so much i’ll try

---

<div class="post-metadata">

**Author:** ![fabiobalsamo](https://avatars.discourse-cdn.com/v4/letter/f/47e85d/32.png) [@fabiobalsamo](https://forum.ionicframework.com/u/fabiobalsamo)\
**Post date:** [December 21, 2015, 2:46pm UTC](https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522/4 "2015-12-21T14:46:57Z")

</div>

i have this code  
the object came from an http request and it’s a json file

for(var i=0;i\<response.queueElements.length;i++){  
var newObject = {  
//forse togliere elementi e columns  
//elementi:response.queueElements[i],  
caseFolderId:response.queueElements[i].caseFolderId,  
caseTaskId:response.queueElements[i].caseTaskId,  
stepName:response.queueElements[i].stepName,  
columns:response.queueElements[i].columns,  
DV\_Caseidentifier\_for\_eni\_OdA: response.queueElements[i].columns.DV\_Caseidentifier\_for\_eni\_OdA,  
DV\_EBELP\_ODA: response.queueElements[i].columns.DV\_EBELP\_ODA,  
DV\_EINDT\_ODA: response.queueElements[i].columns.DV\_EINDT\_ODA,  
DV\_MATNR\_TXZ01\_POS\_ODA: response.queueElements[i].columns.DV\_MATNR\_TXZ01\_POS\_ODA,  
DV\_NAMECL\_POS\_ODA: response.queueElements[i].columns.DV\_NAMECL\_POS\_ODA,  
DV\_NETPR\_WAERS\_POS\_ODA: response.queueElements[i].columns.DV\_NETPR\_WAERS\_POS\_ODA,  
DV\_PEINH\_POS: response.queueElements[i].columns.DV\_PEINH\_POS,  
DV\_MENGE\_MEINS\_POS\_ODA: response.queueElements[i].columns.DV\_MENGE\_MEINS\_POS\_ODA  
};  
newArray.push(newObject);  
[//console.log](https://console.log)("nuovo oggetto " + newObject);  
console.log("dettaglio " + newObject.DV\_MENGE\_MEINS\_POS\_ODA + " " + newObject.stepName + " " + newObject.DV\_EINDT\_ODA);

//anche qui ho tutto il JSON  
$rootScope.newObjectJSON.push(JSON.stringify(newObject));  
console.log("rootScope.newObjectJSON " + $rootScope.newObjectJSON);  
// $rootScope.newObjectJSON = JSON.stringify(newObject);

//DA TESTARE  
jsonString = $rootScope.newObjectJSON;  
jsonStringArray = jsonString.replace(/("{|}")/gi,’"’);

console.log("senza parentesi "+jsonStringArray);

thee log say  
TypeError: Object [object Array] has no method ‘replace’

any suggestion? Thanks

---

<div class="post-metadata">

**Author:** ![andrewmcgivery](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/andrewmcgivery/32/65523_2.png) [@andrewmcgivery](https://forum.ionicframework.com/u/andrewmcgivery)\
**Post date:** [December 21, 2015, 8:35pm UTC](https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522/5 "2015-12-21T20:35:05Z")

</div>

Look at my example… I was running the replace on a string… you’re trying to run it on an array…

---

<div class="post-metadata">

**Author:** ![fabiobalsamo](https://avatars.discourse-cdn.com/v4/letter/f/47e85d/32.png) [@fabiobalsamo](https://forum.ionicframework.com/u/fabiobalsamo)\
**Post date:** [December 21, 2015, 9:17pm UTC](https://forum.ionicframework.com/t/how-remove-curly-braces-from-all-string-of-a-json/39522/6 "2015-12-21T21:17:11Z")

</div>

and it’s not possible???how can i do? or I can i do instead!!! maybe put in the db in the correct way??
