大家好,我有字符串<span class="lnk">Участники <span class="clgry">59728</span></span>
我解析它
string population = Regex.Match(content, @"Участники <span class=""clgry"">(?<id>[^""]+?)</span>").Groups["id"].Value;
int j = 0;
if (!string.IsNullOrEmpty(population))
{
log("[+] Группа: " + group + " Учасники: " + population + "\r\n");
int population_int = Convert.ToInt32(population);
if (population_int > 20000)
{
lock (accslocker)
{
StreamWriter file = new StreamWriter("opened.txt", true);
file.Write(group + ":" + population + "\r\n");
file.Close();
}
j++;
}
}
但是当我的字符串是><span class="lnk">Участники <span class="clgry"></span></span>
我收到一个扩展“输入字符串的格式不正确”。如何避免?