Javascript examples for String Operation:String Replace
Use regex to find and concatenating the particular strings
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w . j av a2 s. co m var s='This is a demo from "Java script". This Demo uses "Regex"'; var reg=/\"(.*?)\"/g; var result=s.match(reg).join('+').replace(/"/g,""); console.log(result); } </script> </head> <body> </body> </html>