Re: [問題] 如何把字串中的特定字串擷取出來

看板C_Sharp (C#)作者 (替機殼洗個熱水澡)時間19年前 (2006/02/18 21:39), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/9 (看更多)
自己 parse 不如給 IE 核心去Parse XD 純搗蛋 <html xmlns="http://www.w3.org/1999/xhtml" > <head><title> Index </title></head> <body> <a href="http://www.google.com.tw" rel="nofollow">http://www.google.com.tw">http://www.google.com.tw</a> <p><a href="kimo" rel="nofollow">http://www.kimo.com.tw">kimo</a> <p><a href="This is a error">></aThis is an error link.</a> <script> \var i; for(i =0 ; i < document.links.length; i++) alert(document.links[i].innerText); </script> </p> </body> </html> ※ 引述《welon (小龍)》之銘言: : ※ 引述《terrytai (Terry)》之銘言: : : 如果要從一個html檔案中找出特定的字串 : : 整個原始碼抓出來的字串設程string tempCode : : 已經知道我想要的字串前面一定有> : : 後面一定有</a> : : 如何把html檔案中每個符合這個條件的字串 : : 都抓出來另存成新的字串? : : 那麼我是不是就先設了string StartString = ">"; : : string EndString = "</a>"; : : 然後呢? : : 怎麼去找出介於StartString跟EndString中間的每個字串? : 不要那麼麻煩吧 用到RE 他的感覺是元件就能解決了 : VS.net 2005 c# 就有 webBrowser 的控制項了 : 不用那麼麻煩用 RE 去解決這個問題 : wahaha -- ----------------------------------------------------------------------------- 功課重,Project多的好幫手--專案王 http://steven.twbbs.org/ProjectKing 增加右鍵的威力RightMenuKing--右鍵王 http://steven.twbbs.org/RightMenuKing/ 備份重要檔案的好幫BackupKing--備份王 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.123.165 ※ 編輯: virdust2003 來自: 140.113.123.165 (02/18 21:43)
文章代碼(AID): #13zoE9oB (C_Sharp)
討論串 (同標題文章)
文章代碼(AID): #13zoE9oB (C_Sharp)