

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to remove two parts of a string with JavaScript?
To remove text between two parts of a string, use JavaScript regex.
Example
You can try to run the following code to learn how to remove text between parentheses −
<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>
Output
- Related Questions & Answers
- Replace parts of a string with C# Regex
- Splitting a string into parts in JavaScript
- Divide a string into n equal parts - JavaScript
- Splitting a string into maximum parts in JavaScript
- Split string into equal parts JavaScript
- Program to check two parts of a string are palindrome or not in Python
- Remove characters from a string contained in another string with JavaScript?
- How to remove text from a string in JavaScript?
- Parts of array with n different elements in JavaScript
- How to remove html tags from a string in JavaScript?
- How to remove “,” from a string in JavaScript
- How to add two strings with a space in first string in JavaScript?
- C++ Partition a Number into Two Divisible Parts
- How to remove event listener with JavaScript?
- How to return a new string with a specified number of copies of an existing string with JavaScript?
Advertisements