第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從字符串中刪除所有 <br> 標(biāo)簽

如何從字符串中刪除所有 <br> 標(biāo)簽

蝴蝶不菲 2023-06-09 17:24:01
我有一個大繩子Hello<br>I am a On then sake home is am leaf<br> Of suspicion do departure at extremely he believing.<br> Do know said mind do rent they oh hope of <br> General enquire picture letters garrets onoffices of no on<br> Say one hearing between excited evening all inhabit thought you<br> Style begin mrheard by in music tried do<br> To unreserved projection no introduced invitation<br> .... 1200 words.<br>現(xiàn)在我想用“”替換那些標(biāo)簽。我不知道正則表達(dá)式,有人可以幫我嗎?而且我使用了 javascript 字符串替換,但沒有用。
查看完整描述

1 回答

?
海綿寶寶撒

TA貢獻(xiàn)1809條經(jīng)驗 獲得超8個贊

替換<br>常規(guī)空間" "。


const yourString = "Hello<br>I am a On then sake home is am leaf<br> Of suspicion do departure at extremely he believing.<br> Do know said mind do rent they oh hope of <br> General enquire picture letters garrets on offices of no on<br> Say one hearing between excited evening all inhabit thought you<br> Style begin mr heard by in music tried do<br> To unreserved projection no introduced invitation<br>"


const result = yourString

.replace(/<br>/gi," ")      // REPLACES ALL <br> OCCURRENCES FOR A REGULAR SPACE

.replace(/\s+/g," ")        // REPLACES POSSIBLE MULTIPLE SPACES FOR A SINGLE SPACE

.trim();                    // REMOVES POSSIBLE SPACES FROM THE BEGINNING AND END OF THE STRING

  

console.log(result);


替換<br>常規(guī)的新行"\n"。


const yourString = "Hello<br>I am a On then sake home is am leaf<br> Of suspicion do departure at extremely he believing.<br> Do know said mind do rent they oh hope of <br> General enquire picture letters garrets on offices of no on<br> Say one hearing between excited evening all inhabit thought you<br> Style begin mr heard by in music tried do<br> To unreserved projection no introduced invitation<br>"


const result = yourString

.replace(/<br>\s*/gi,"\n")      // REPLACES ALL <br> FOLLOWED BY 0 OR MORE SAPCES FOR A NEW LINE

.trim();                    // REMOVES POSSIBLE SPACES FROM THE BEGINNING AND END OF THE STRING

  

console.log(result);


查看完整回答
反對 回復(fù) 2023-06-09
  • 1 回答
  • 0 關(guān)注
  • 171 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號