Can I remove text from a StringWriter ?
I have a StringWriter object, the content of which looks like this:
"<div>Some other html which I wish to keep</div>"
Can I remove the unwanted <div>, </divtags? i.e. remove the last 4
characters and the first 3.
The context in which the object occurs, in asp.net code, is:
StringWriter sw = new StringWriter();
HtmlTextWriter htmlTw = new HtmlTextWriter(sw);
gvExcel.RenderControl(htmlTw);
Response.Write("<html>\r\n<head>\r\n");
Response.Write("<meta http-equiv=\"Content-Type\"
content=\"text/html; charset=UTF-8\" />\r\n");
Response.Write("</head>\r\n<body>\r\n");
Response.Write(sw.ToString());
Response.Write("\r\n</body>\r\n</html>");
This code is used to write a html file with a .xls extension which can
be loaded into excel.
I don't want the dummy <divto be there .
gvExcel is an asp.net GridView control.