473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

.replace for linefeeds?

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
2 1485
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Danny | last post by:
I need an asp command to strip out from a string all extra punctuation such as apostrophe, comma, period, spaces dashes, etc etc and just leave the letters. Can anybody give me some ideas? ...
23
by: SeaPlusPlus | last post by:
I want to convert large files of prose to xhtml and so I need a way to remove unwanted line wraps. So, I'm looking for a freebee editor that has the capability of searching for a single "carriage...
3
by: lino | last post by:
Hello, I have the following string: const char plaintext = "Fourscore and seven years ago our \ fathers brought forth upon this continent \ a new nation, conceived in liberty, and dedicated...
1
by: Grant Mills | last post by:
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. ...
15
by: tshad | last post by:
How do I go about this? I used to know this, but can't find VB.net replace that does this. Something like string.replace("<br>",NL) Thanks,
2
by: Øyvind Isaksen | last post by:
Hi! I use this function to show the text with linefeeds on my webpages: ----------------------------------- replace(myText,Chr(13),"<br>") ---------------------------------- This works...
0
by: Kevin Hodgson | last post by:
I'm having a problem with System.Web.Mail.MailMessage losing linefeeds when creating an email. This is a VB.NET project. I use a stringbuilder to construct the MailMessage.Body and use vbCrLf...
6
by: JackpipE | last post by:
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate...
1
by: dino d. | last post by:
I need to parse a string by linefeeds and paragraphs. I need to preserve all periods and linefeeds too, so I can't simply use strtok or explode (both of which don't tell you where or which (period...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.