开发者

how to convert the html tags and get a message in string

how to convert the html tags to the msg bodg in mail function.

i.e i have

  Company Name: BPL

  Industry Type:  

开发者_如何学Python

i have got the string as

datatable dt=new datatable();

string msg= dt.rows[i]["Message"].tostring();

i need to convert this html tags to the exact message;

           if (boolcheck)
            {
                msg.Body = ????????? wat to use over here.... how to remove the html tags and get the exact message

            }

pls help??????????/


This should help you.

public string Strip(string text)
{
    return Regex.Replace(text, @”<(.|\n)*?>”, string.Empty);
}

to remove a perticular tag try this one http://urenjoy.blogspot.com/2008/10/remove-html-tags-from-string.html


Use Regular expressions

Regex.Replace(msg, "<.*?>", string.Empty);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜