473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

white space removal tools?

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
Jul 14 '08 #1
3 1849
On Jul 15, 7:33*am, "K" <some...@microsoft.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.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.
Jul 15 '08 #2
K
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" <zz*******@gmail.comwrote in message
news:a9**********************************@a70g2000 hsh.googlegroups.com...
On Jul 15, 7:33 am, "K" <some...@microsoft.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.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.
Jul 15 '08 #3
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...@microsoft.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.com/), any experience with this or similar *packages?

tx for your reply anyway

"nick chan" <zzzxtr...@gmail.comwrote in message

news:a9**********************************@a70g2000 hsh.googlegroups.com...
On Jul 15, 7:33 am, "K" <some...@microsoft.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.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.
Jul 16 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Grumble | last post by:
Hello all, I want to read lines from a text file, where each line has the following syntax: token1:token2:token3 There could be white space between tokens and ':'
2
by: Malcolm Dew-Jones | last post by:
I am looking at xslt 1.0 and trying to understand if empty text nodes are supposed to be stripped or not as the default behaviour. 3.4 starts by listing rules for when white space is not stripped...
0
by: Mark Moore | last post by:
I'm trying to layout a couple text input fields and their corresponding labels without using a table. When I was trying to debug my understanding of CSS, I was *very* surprised to see that span's...
38
by: Xah Lee | last post by:
sometimes i wish to add white space in <p> as to achived effects similar to tab. what should i do? using empty image seems the sure way but rather complicated. (and dosen't change size with...
2
by: David Richards | last post by:
Hi, Hopefully someone can help me. I have setup a continuous form that displays customer names and addresses. I have then place a txt box on the form header. Using the onChange event I've setup...
2
by: shagy | last post by:
Hi, I'm having a problem with a <select><option> which has white space in values... When I post the data I only get the first word (up to the white space). "Testing white space" becomes...
22
by: Brent | last post by:
I want to paste a lengthly text document into a web page and have it retain all of whitespace and line breaks. I first tried the <pretag but that didn't work because it doesn't wrap the text. I...
4
by: asnowfall | last post by:
If I have white space in the <atag, IE interpretes it as line break. I tried setting "whie-space: pre" and it did not seem to affect. Here is a sample. ...
4
by: mosesdinakaran | last post by:
Can any one explain how the rule is applied for the following Regular expression $Str = 'the red king'; $Pattern = '/((red|white) (king|queen))/'; preg_match($Pattern,$Str,$Val); Result:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.