var str = '零五科技(www.02405.com),分享(各种)IT知识!';
//移除字符串中的所有()括号(不包括括号中的内容)
console.log(str.replace(/\[|]/g,''));
//输出:零五科技www.02405.com,分享各种IT知识!
//移除字符串中的所有()括号(包括括号中的内容)
console.log(str.replace(/\[.*?\]/g,''));
//输出:零五科技,分享IT知识!
JS去除字符串中的所有括号及括号中的内容
0 Previous ArticleLaravel提示The GET method is not supported for this route. Supported methods: POST.错误的解决办法
Next Article PHP 判断 Session 是否“已开启”