Javascript examples for String Operation:String Replace
Trim a specific character off the start & end of a string using regex
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww . j av a 2s . c o m*/ var myString = '"""""""""""""test " test""""""""""""""'; myString = myString.replace(/^"+|"+$/g, ''); console.log(myString); } </script> </head> <body> </body> </html>