I have the line "{Street Name}, {City}, {Country}" and you want to remove all curly braces. The result should be "Street Name, City, County." How to do it?
If you want to remove all occurrences of { and } regardless of whether they match pairs, you can do this as follows:
{
}
var str = "{Street Name}, {City}, {Country}"; str = str.replace(/[{}]/g, "");
The character class [{}] will find all curly braces
[{}]
var address = "{Street Name}, {City}, {Country}"; address = address.replace( /[{}]/g, '' ); console.log( address ) // Street Name, City, Country
str = str.replace(/[{}]/g,"");
Use this simple javascript code in your corresponding function to remove curly braces:
var str = '{Street Name}, {City}, {Country}'; str = str.replace(/{/g, '').replace(/}/g, '');
Source: https://habr.com/ru/post/902619/More articles:why boost :: call_traits :: param_type is "const double &" and not "double" - c ++Android: Sign in with Twitter4J - androidPython documentation: repeated many times? - pythonTwo functions of viewing scroll At the same time with one touch - iosPermanent memory versus texture memory and global memory in CUDA - memoryglobal vs shared memory in CUDA - cudaUsing global and persistent memory in CUDA - memorypkg-config does not work on Cygwin - c ++Scala: normal functions versus alternating functions? - functionDatatable in using? - c #All Articles