小编Cha*_*hty的帖子

Javascript,如何删除括号前的值以及它自己的括号

 var s = "1236(75)";
 var s = s.replace(/\(|\)/g, '');

 alert (s); // this gives me 123675  


what i actually need is 75

any help will be appreciated!
Run Code Online (Sandbox Code Playgroud)

上面的代码结果是123675,但我需要它才能返回75,请帮忙

javascript regex replace parentheses

1
推荐指数
1
解决办法
706
查看次数

标签 统计

javascript ×1

parentheses ×1

regex ×1

replace ×1