value = value.replace('[b]', '');
value = value.replace('[/b]', '');
如何优化此代码?
我有一种感觉,我可以用正则表达式来做到这一点。就像是
value.replace('/^[\/?b]/', '');
但我无法弄清楚。
value = value.replace('[b]', '');
value = value.replace('[/b]', '');
如何优化此代码?
我有一种感觉,我可以用正则表达式来做到这一点。就像是
value.replace('/^[\/?b]/', '');
但我无法弄清楚。