By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,129 Members | 2,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,129 IT Pros & Developers. It's quick & easy.

.replace for linefeeds?

P: n/a
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?




Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Can you wrap the html text in <pre></pre> tags....

HTH

MarTin..
"Grant Mills" <mi**********@noDamSpamTelusplanet.net> wrote in message
news:MVVoc.5037$j6.3655@edtnps84...
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?




Nov 18 '05 #2

P: n/a
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.
--
Joe Fallon

"Grant Mills" <mi**********@noDamSpamTelusplanet.net> wrote in message
news:MVVoc.5037$j6.3655@edtnps84...
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?




Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.