Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

replace()

LEGEND ,
Mar 26, 2008 Mar 26, 2008
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?
--

TOPICS
Server side applications
264
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 26, 2008 Mar 26, 2008
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 27, 2008 Mar 27, 2008
LATEST
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines