Home > Net >  How to remove brackets and number form string in jquery
How to remove brackets and number form string in jquery

Time:10-06

My String:

var string = 'Testing(10)';

I want to remove '(10)' form string with usign jquery

CodePudding user response:

You actually don't need jquery for this:

You can do it like this: string.replace(/ *\([^)]*\)*/g, "")

Demo

var string = 'Testing(10)';


console.log(string.replace(/ *\([^)]*\)*/g, ""))

  • Related