I get errors when I try any of the following:
str = str.replace(/</p>/gm, "")
str = str.replace("</p>"/gm, "")
What am I doing wrong?
'/'是一个特殊字符,您必须在正则表达式中将其转义:
str = str.replace(/<\/p>/gm, "");
tr = str.replace(/\<\/p\>/gi, "")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.