我想從字符串中刪除不必要的字符串:<br>
,<br/>
和<br />
,該字符串可能包含行中的許多字符串。例如:從字符串中刪除多餘的<br>'
This is a string with <br><br/> many <br/><br> newlines. <br><br><br /><br> But it's ok <br> to have one!
我想它變成這樣:
This is a string with <br> many <br> newlines. <br> But it's ok <br> to have one!
這也重複後'br's(也忽略'br's帶屬性) –
工作以及消除任何空間! http://jsfiddle.net/tYM4M/1/ –
的downvotes是最有可能的純意識形態,因爲你使用正則表達式來操作HTML –