remove a set of characters from a script [duplicate]
How to remove <p>
and </p>
from a text in javascript?
I have a string
<p> This is a text</p>
and I want to remove the <p>
and the </p>
.
How can I do that in Javascript?
Use the replace()
function.
For example: "<p> This is a text</p>".replace(/<\/?p>/g,"")
.
精彩评论