Sinal Sinal - 1 year ago 141
Javascript Question

Javascript Remove Braces

I have the string "{Street Name}, {City}, {Country}" and want to remove all braces.
The result should be "Street Name, City, County".

Answer Source

If you want to remove all occurrences of { and } whether or not they are matched pairs, you can do it like this:

var str = "{Street Name}, {City}, {Country}";
str = str.replace(/[{}]/g, "");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download