white space removal tools?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • K

    white space removal tools?

    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


  • nick chan

    #2
    Re: white space removal tools?

    On Jul 15, 7:33 am, "K" <some...@micros oft.comwrote:
    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.H tmlTextWriter)

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

    MyBase.Render(h w)
    Dim html As String = sb.ToString
    While html.IndexOf(vb Tab) <-1
    html = html.Replace(vb Tab, String.Empty)
    End While
    writer.Write(ht ml)
    end sub


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

    Comment

    • K

      #3
      Re: white space removal tools?

      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



      "nick chan" <zzzxtreme@gmai l.comwrote in message
      news:a942e8b1-1866-4073-8941-4e280955b9fc@a7 0g2000hsh.googl egroups.com...
      On Jul 15, 7:33 am, "K" <some...@micros oft.comwrote:
      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.H tmlTextWriter)

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

      MyBase.Render(h w)
      Dim html As String = sb.ToString
      While html.IndexOf(vb Tab) <-1
      html = html.Replace(vb Tab, String.Empty)
      End While
      writer.Write(ht ml)
      end sub


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


      Comment

      • nick chan

        #4
        Re: white space removal tools?

        i thot u don't have access to isapi filter
        but anyway, the HTmltextWrite is easy enough


        On Jul 15, 2:49 pm, "K" <some...@micros oft.comwrote:
        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 (fromhttp://www.limbolabs.c om/), any experience with this or similar  packages?
        >
        tx for your reply anyway
        >
        "nick chan" <zzzxtr...@gmai l.comwrote in message
        >
        news:a942e8b1-1866-4073-8941-4e280955b9fc@a7 0g2000hsh.googl egroups.com...
        On Jul 15, 7:33 am, "K" <some...@micros oft.comwrote:
        >
        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.H tmlTextWriter)
        >
        Dim sb As New StringBuilder
        Dim sw As New IO.StringWriter (sb)
        Dim hw As New HtmlTextWriter( sw)
        >
        MyBase.Render(h w)
        Dim html As String = sb.ToString
                While html.IndexOf(vb Tab) <-1
        html = html.Replace(vb Tab, String.Empty)
        End While
                        writer.Write(ht ml)
        end sub
        >
        i was only testing, using While loop to replace Tabs. more "ethically"
        you could use RegExp to replace spaces or whatever.

        Comment

        Working...