-
Hello,
Gotta small question. I am trying to convert the output of a database query, objRec("positiondescription") into HTML.
The database holds regular text, but is there an elegant
way to turn linebreaks in <br>?
I tried the HTML <pre> tag but I don't like the typewriter like font. It doesn't word wrap well, either.
Thanks so much,
Scott
-
Hi,
You can use this:
Code:
Function toHTML(strText)
Dim strHTML
If IsNull(strText) Then
strHTML = ""
Else
strHTML = Replace(strText, Chr(13), "<br>")
End If
toHTML = strHTML
End Function
Then to use it:
Code:
Response.Write(toHTML(objRec("positiondescription").Value))
That should do the trick.
-
Works like a champ! Thanks so much...
Scott