string html = @"<ll>abcdefg</ll> <pp>1234567</pp>";
bool isValid = true;
List<byte> buffer = new List<byte>();
foreach (byte x in html.ToCharArray())
{
if (x == '<')
{
isValid = false;
}
if (isValid == true)
{
buffer.Add(x);
}
if (x == '>')
{
isValid = true;
}
}
string cleanString = Encoding.ASCII.GetString(buffer.ToArray());
MessageBox.Show(cleanString);
bool isValid = true;
List<byte> buffer = new List<byte>();
foreach (byte x in html.ToCharArray())
{
if (x == '<')
{
isValid = false;
}
if (isValid == true)
{
buffer.Add(x);
}
if (x == '>')
{
isValid = true;
}
}
string cleanString = Encoding.ASCII.GetString(buffer.ToArray());
MessageBox.Show(cleanString);