Skip to main content
Inspiring
Mar 26, 2008 4:01 PM UTC
Question

replace()

ASP classic & VBscript & MSSQL

I currently have this field displaying, replacing line feeds with >BR>

<%= Replace((rs_bar.Fields.Item("News").Value),Chr(13), "<br>") %>

and it work fine

Now I also want to replace chr(32), a space, with  . I tried this

<%= Replace(Replace((rs_bar.Fields.Item("News").Value),Chr(13),
"<br>"),Chr(32)," ") %>


It replaces the char(32) but not the chr(13)'s. If and how should this
be done?
--

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
Mar 27, 2008 4:43 PM UTC
Thanks but sorry Baxter that did not work. However, after going back
and making a vb server script I determined my approach was flawed and
doomed to failure. My original double replace did exactly what I told
it to do but not what I wanted it to do.

Anyway, it got me into the power of server scripting deeper than I have
been in the past.

Translate
Inspiring
Mar 26, 2008 9:02 PM UTC
Try this,
<%= Replace(Replace((rs_bar.Fields.Item("News").Value),Chr(13), "<br>") &
Chr(32)," ") %>
Dave


"Philo" <meansyou@nospam.net> wrote in message
news:fsds15$rvb$1@forums.macromedia.com...
> ASP classic & VBscript & MSSQL
>
> I currently have this field displaying, replacing line feeds with >BR>
>
> <%= Replace((rs_bar.Fields.Item("News").Value),Chr(13), "<br>") %>
>
> and it work fine
>
> Now I also want to replace chr(32), a space, with  . I tried this
>
> <%= Replace(Replace((rs_bar.Fields.Item("News").Value),Chr(13),
> "<br>"),Chr(32)," ") %>
>
>
> It replaces the char(32) but not the chr(13)'s. If and how should this
> be done?
> --
>


Translate