white space removal tools?

  • Thread starter Thread starter K
  • Start date Start date
K

K

Hi

What software are you using to remove unnecessary white space from your html
output? I'm on shared hosting so I don't have the luxury of installing an
isapi filter...

any tips?

tx
 
Hi

What software are you using to remove unnecessary white space from your html
output? I'm on shared hosting so I don't have the luxury of installing an
isapi filter...

any tips?

tx

something like this in my base page class

Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)

Dim sb As New StringBuilder
Dim sw As New IO.StringWriter(sb)
Dim hw As New HtmlTextWriter(sw)

MyBase.Render(hw)
Dim html As String = sb.ToString
While html.IndexOf(vbTab) <> -1
html = html.Replace(vbTab, String.Empty)
End While
writer.Write(html)
end sub


i was only testing, using While loop to replace Tabs. more "ethically"
you could use RegExp to replace spaces or whatever.
 
Hi Nick

Doesn't the Replace method replace all characters (tabs) in the string, so
there's no need for the while? And surely this won't work for spaces...

I'm evaluating a third party response filter for this purpose now (from
http://www.limbolabs.com/), any experience with this or similar packages?

tx for your reply anyway



Hi

What software are you using to remove unnecessary white space from your
html
output? I'm on shared hosting so I don't have the luxury of installing an
isapi filter...

any tips?

tx

something like this in my base page class

Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)

Dim sb As New StringBuilder
Dim sw As New IO.StringWriter(sb)
Dim hw As New HtmlTextWriter(sw)

MyBase.Render(hw)
Dim html As String = sb.ToString
While html.IndexOf(vbTab) <> -1
html = html.Replace(vbTab, String.Empty)
End While
writer.Write(html)
end sub


i was only testing, using While loop to replace Tabs. more "ethically"
you could use RegExp to replace spaces or whatever.
 
i thot u don't have access to isapi filter
but anyway, the HTmltextWrite is easy enough
 
Back
Top