using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Diagnostics;
namespace 查HTML是否閉合
{
class TagsList
{
private ArrayList data;
public int Size
{
get
{
return data.Count;
}
}
public TagsList()
{
data = new ArrayList();
}
public void add(String str)
{
data.Add(str);
}
public string get(int index)
{
if (index < data.Count)
return (string)data[index];
else
return null;
}
public bool remove(string str)
{
if (data.IndexOf(str) == -1) return false;
data.Remove(str);
return true;
}
public void remove(int index)
{
data.RemoveAt(index);
}
}
public class TagsChecker
{
public static bool check(string str)
{
TagsList[] unclosedTags = getUnclosedTags(str);
if (unclosedTags[0].Size != 0)
{
return false