Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save white space??

Status
Not open for further replies.

webIntern

Programmer
Nov 22, 2002
40
US
Hi, All

I'm working on a page that changes dynamically with changes to a database. There is a large chunk of text that is queried from a database to be displayed on the asp page. I'd like to save the white space that is already in this text - including the carriage returns and such. How would I do that without using the <pre> tag?

 
For carriage returns just replace vbcrlf with <br>

MyText = Replace(MyText,vbcrlf,&quot;<br>&quot;)

Then when you out put it, you can replace it back.

As far as white spaces go, the database won't erase them as far as I know, but if you must do something with them to keep them exsistent for some reason, just replace them with a unused letter or a group of symbols or something.. like #~# but I can't figure out why you need to &quot;keep&quot; spaces.

- Jason

www.vzio.com
ASP WEB DEVELOPMENT



 
I need to keep the spaces because they're already formatted for how we want them to look. These are press releases/articles about our company.

Thanks - I'll give it a try.
 
No problem, I do what I can!

But remember replacing your spaces with 1 character is scary because a user could use that character... but more then 1 could be more space used up in the db... but that all depends on the number of records and how many spaces I guess..

- Jason

www.vzio.com
ASP WEB DEVELOPMENT



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top