.replace for linefeeds?

G

Grant Mills

I'm trying to get linefeeds to display correctly in a datagrid (text is
taken from a database of text that has been htmlencoded)

By default it doesn't display them. But <br/> tags display fine.


however, when I do

validated.Replace(vbCrLf, "<br/>")

or

validated.Replace(chr(10), "<br/>")

or

validated.Replace(chr(13), "<")

or even a function with this

While (posistion < validated.Length And posistion > -1)

posistion = validated.IndexOf(vbcrlf, posistion) (tried the other
combinations)

If posistion = -1 Then


Exit While

End If

validated.Remove(posistion, 1)

validated.Insert(posistion, "<br/>")

posistion = posistion + 5

End While





None of that seems to remove and replace at all.. can anyone suggest what I
can do?
 
J

Joe Fallon

validated.Replace(vbCrLf, "<br/>")

I use the above technique and it works fine.

So I can only conclude you do NOT have any vbCRLFs in your data!

I recommend you parse it to identify what the real character is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top