本文整理汇总了C#中HtmlAgilityPack.HtmlNodeCollection.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlNodeCollection.RemoveAt方法的具体用法?C# HtmlNodeCollection.RemoveAt怎么用?C# HtmlNodeCollection.RemoveAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlAgilityPack.HtmlNodeCollection
的用法示例。
在下文中一共展示了HtmlNodeCollection.RemoveAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: removeTextNodes
private static HtmlNodeCollection removeTextNodes (HtmlNodeCollection collection)
{
for (int i = 0; i < collection.Count; i++)
{
if (collection[i].Name == "#text")
{
collection.RemoveAt(i);
//Not in final!!!
i--;
continue;
}
}
return collection;
}
示例2: GetTeamScoreTSLC
/// <summary>
/// 取得比分
/// </summary>
/// <param name="tdColl">比分資料節點集合</param>
/// <param name="scoreboard">賽事比分</param>
/// <param name="R">R分</param>
/// <param name="H">H分</param>
/// <param name="E">E分</param>
private void GetTeamScoreTSLC(HtmlNodeCollection tdColl, List<string> scoreboard, out string R, out string H, out string E)
{
R = String.Empty;
H = String.Empty;
E = String.Empty;
//去掉没用的
tdColl.RemoveAt(0);
foreach (HtmlNode td in tdColl)
{
if (string.IsNullOrWhiteSpace(td.InnerText.Trim()))
{
continue;
}
scoreboard.Add(td.InnerText.Trim());
}
if (scoreboard.Count > 0)
{
E = scoreboard[scoreboard.Count - 1];
scoreboard.RemoveAt(scoreboard.Count - 1);
H = scoreboard[scoreboard.Count - 1];
scoreboard.RemoveAt(scoreboard.Count - 1);
R = scoreboard[scoreboard.Count - 1];
scoreboard.RemoveAt(scoreboard.Count - 1);
}
}
示例3: RemoveTextAttributes
private HtmlNodeCollection RemoveTextAttributes (HtmlNodeCollection collection)
{
for (int i = 0; i < collection.Count; i++)
{
if (collection[i].Name == "#text")
{
collection.RemoveAt(i);
i--;
}
}
return collection;
}
示例4: GetTeamScore
private void GetTeamScore(HtmlNodeCollection tdColl, List<string> scoreboard, out string R, out string H, out string E)
{
R = H = E = string.Empty;
if (tdColl == null) return;
//去掉没用的
tdColl.RemoveAt(0);
foreach (HtmlNode td in tdColl)
{
if (string.IsNullOrWhiteSpace(td.InnerText.Trim()) || td.InnerText.Trim() == "-" || td.InnerText.Trim() == " ")
{
continue;
}
scoreboard.Add(td.InnerText.Replace(" ", "").Trim());
}
if (scoreboard.Count > 0)
{
E = scoreboard[scoreboard.Count - 1];
scoreboard.RemoveAt(scoreboard.Count - 1);
H = scoreboard[scoreboard.Count - 1];
scoreboard.RemoveAt(scoreboard.Count - 1);
R = scoreboard[scoreboard.Count - 1];
scoreboard.RemoveAt(scoreboard.Count - 1);
}
}