स्ट्रिंग के दो हिस्सों के बीच के टेक्स्ट को हटाने के लिए, JavaScript regex का उपयोग करें।
उदाहरण
कोष्ठक के बीच के टेक्स्ट को निकालने का तरीका जानने के लिए आप निम्न कोड को चलाने का प्रयास कर सकते हैं -
<html>
<head>
<script>
var str = "Welcome to Qries (website)";
document.write(str);
// Removing text between parentheses
document.write("<br>"+str.replace(/ *\([^)]*\) */g, ""));
</script>
</head>
<body>
</body>
</html> आउटपुट
