下記の文字列は次のとおりです。がどのようにC#でLINQを使用して文字列を分割する
コードで今<table align="center" style="width: 800px;" border="0" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td id="litxt_1">Note : <input name="txt_1" tabindex="0" title="testTitle" disabled="disabled" id="txt_1" style="cursor: not-allowed; background-color: rgb(204, 204, 204);" type="text" size="100" value=""></td>
</tr>
<tr>
<td style="text-align: center;"><u><span style="font-size: 18px;"><strong>Test Split<br>
(Test Query)</strong></span></u></td>
</tr>
<tr>
<td id="lichk_2"> <input name="chk_2" tabindex="0" title="testTitle" disabled="disabled" id="chk_2" style="cursor: not-allowed; background-color: rgb(204, 204, 204);" type="checkbox" value="1" rel="#"></td>
</tr>
<tr>
<td id="lichk_3"> <input name="chk_3" tabindex="0" title="test Title" disabled="disabled" id="chk_3" style="cursor: not-allowed; background-color: rgb(204, 204, 204);" type="checkbox" value="1" rel="#"></td>
</tr>
</tbody>
</table>
string strAllline = File.ReadAllText("above html path");
string[] strResult = // strAllline.Split();
の後ろに、私は、配列の結果を取得しようとしています
strAllline.Split().Where(s => s.StartsWith("<input "))
に変換することができないでregexや純粋な文字列メソッドでもHTMLを解析(または分割)してみてください。 [HtmlAgilityPack](https://htmlagilitypack.codeplex.com/)のようなhtml-parserを使用してください –
@TimSchmelter私はなぜ尋ねることができますか?ちょっと興味があるんだけど。 – Badiparmagi
xml解析は、親子関係を保ち、配列構造を保つことができます。 – jdweng