Java + JS去除網頁HTML標籤
同樣是工作上用到,在前(Javascript)、後端(Java、JSP)同樣都有的一個需求,就是必須將讀入的字串去除HTML Tag,以下是兩個範例:
var HTML = ""; HTML+= "<p>HTML P Tag String</p>"; HTML+= "<p><a href='/test/link.html'>HTML A Tag String</a></p>"; var htmlTagPattern = /<{1}[^>]{1,}>{1}/g; //HTML Tag Pattern var htmlSplit = HTML.replace(htmlTagPattern, ""); //移除HTML Tag console.log("htmlSplit : " , htmlSplit); //輸出htmlSplit : HTML P Tag StringHTML A Tag String
package CDIT.stanley; public class trimHTML { public static void main(String[] args) { String HTML = ""; HTML+= "<p>HTML P Tag String</p>"; HTML+= "<p><a href='/test/link.html'>HTML A Tag String</a></p>"; String htmlTagPattern = "<{1}[^>]{1,}>{1}"; //HTML Tag Pattern String htmlSplit = HTML.replaceAll(htmlTagPattern, ""); //移除HTML Tag System.out.println("htmlSplit : " + htmlSplit); //輸出htmlSplit : HTML P Tag StringHTML A Tag String } }
Pretty! This has been an extremely wonderful article. Many thanks for providing this info.
Look into my blog; https://www.darknesstr.com/
The Largest Issue That Comes With Modern Leather Sofa, And How You Can Fix It tufted leather sofa (Louann)
az parayla cok kazandiran slot oyunlar? az parayla cok kazandiran slot oyunlar? slot siteleri
az parayla cok kazandiran slot oyunlar?: slot tr online – slot oyunlar?
matadorbet bid: matadorbet – matadorbet.bid
deneme bonusu veren siteler betturkey betturkey.com denemebonusuverensiteler.top deneme bonusu veren siteler yerliarama.org
ultrabet tr online: ultrabet tr online – ultrabet guncel
http://denemebonusuverensiteler.top/# deneme bonusu veren siteler yeni
deneme bonusu veren siteler yerliarama.org
matadorbet giris: matadorbet.bid – matadorbet bid
ultrabet guncel ultrabet yeni giris 1125 ultrabet giris
The 3 Biggest Disasters In Asbestos Injury Attorney History mesothelioma lawyers (Brook)
deneme bonusu veren yeni siteler https://slot-tr.online/# slot tr online
ultrabet: ultrabet guncel – ultrabet
10 Things That Your Family Taught You About Treadmills With Incline For Sale Treadmills With Incline For Sale (Palangshim.Com)
The 10 Most Terrifying Things About Cheap Sofas For Sale sofas For Sale
deneme bonusu veren yeni siteler: deneme bonusu veren siteler mycbet.com – deneme bonusu veren siteler denemebonusu2026.com
11 Ways To Completely Redesign Your Fabric Corner Sofa
Cheap 2 Seater Fabric Sofa
Тут можно преобрести несгораемый сейф цена огнестойкие сейфы
Тут можно преобрести несгораемый сейф огнестойкий сейф купить
slot siteleri slot oyunlar? puf noktalar? en kazancl? slot oyunlar?
http://matadorbet.bid/# matadorbet.bid
deneme bonusu veren siteler mycbet.com
matadorbet.bid: matadorbet.bid – matadorbet.bid
Canl? Casino Siteleri Casino Siteleri guvenilir casino siteleri
How To Become A Prosperous Attorneys Accidents Entrepreneur Even If You’re Not Business-Savvy accident
injury law firm (https://Posteezy.Com)
Why You’ll Want To Learn More About SEO Marketing Agency Professional Seo Agency
http://ultrabet-tr.online/# ultrabet yeni giris 1125
deneme bonusu veren siteler betturkey betturkey.com
My page :: Daycare Near Me – Find The Best Daycares Near You
Guide To Commercial Gas Patio Heaters: The Intermediate Guide
The Steps To Commercial Gas Patio Heaters commercial gas Patio heaters, https://www.bitsdujour.com/profiles/EV0Fow,
deneme bonusu veren siteler mycbet.com deneme bonusu veren siteler mycbet.com deneme bonusu veren siteler betturkey betturkey.com