Skip to main content
Inspiring
September 11, 2006
Answered

replace function in asp

  • September 11, 2006
  • 1 reply
  • 266 views
Hi,
I have a text box whcih saves to a database. When I call the text in the database it displays without showing any of the carriage returns. I know I need to use the replace function, however I'm sure sure where ? Is it before saving to the database ? because I can't see any characters indicating a carriage return in the text saved to the database ? so I'm not sure what to replace ?

OR should I replace before saving ?

I'm sure this a simple one-liner, but can't find it.

Any advice or code snippet appreciated.
This topic has been closed for replies.
Correct answer jsltd
Doh, found my own answer.

<% sometext=recordset.Fields.Item("databasefield").Value
response.write(Replace(sometext, vbCrLf, "<br>"))
%>

1 reply

jsltdAuthorCorrect answer
Inspiring
September 11, 2006
Doh, found my own answer.

<% sometext=recordset.Fields.Item("databasefield").Value
response.write(Replace(sometext, vbCrLf, "<br>"))
%>