I written a vb.net app that reads the contents of an xml file and sets a textbox with one of the elements. I can read the file fine and seperate it but for the life of me can't figure out how to get the newlines from being displayed as 'squares' I've tried replacing them to no avail. here is what I've tried so far: -
recDirections &= _step(i).InnerText
-
recDirections.Replace(vbCr, " ")
-
recDirections.Replace(vbLf, " ")
-
recDirections.Replace(vbCrLf, " ")
-
recDirections.Replace("\n", " ")
-
recDirections.Replace(vbNewLine, " ")
-
recDirections.Replace(Chr(10), " ")
-
recDirections.Replace(Chr(13), " ")
-
recDirections.Replace(Chr(10) & Chr(13), " ")
-
none of these work and I'm at my witts end on this one. I think the problem is with the way the xml file is made, with returns on long lines so that it wraps but I'm not sure. If it is the case, it wouldn't solve my problem as the xml files are made by other users. Any ideas welcome
1 1114
I written a vb.net app that reads the contents of an xml file and sets a textbox with one of the elements. I can read the file fine and seperate it but for the life of me can't figure out how to get the newlines from being displayed as 'squares' I've tried replacing them to no avail. here is what I've tried so far: -
recDirections &= _step(i).InnerText
-
recDirections.Replace(vbCr, " ")
-
recDirections.Replace(vbLf, " ")
-
recDirections.Replace(vbCrLf, " ")
-
recDirections.Replace("\n", " ")
-
recDirections.Replace(vbNewLine, " ")
-
recDirections.Replace(Chr(10), " ")
-
recDirections.Replace(Chr(13), " ")
-
recDirections.Replace(Chr(10) & Chr(13), " ")
-
none of these work and I'm at my witts end on this one. I think the problem is with the way the xml file is made, with returns on long lines so that it wraps but I'm not sure. If it is the case, it wouldn't solve my problem as the xml files are made by other users. Any ideas welcome
Have you tried:
recDirections = recDirections.Replace(Chr(10), ControlChars.Cr)
recDirections = recDirections.Replace(Chr(13), ControlChars.Lf)
You're not ending up replacing anything...because you're not actually assigning the directions with the replaced values to anything...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tomba |
last post by:
hi there,
I am looking for a way to convert line breaks that are written in a textarea
(with an enter) to <br> to create the same line break in html
is there anyone who can help me with this?...
|
by: Mechphisto |
last post by:
I'm using a textarea to insert some notes into a database.
It's inserting the complete result into the mySQL table including the
linebreaks...and not as a visible symbol but an actual linebreak. If...
|
by: bart_nessux |
last post by:
Hello,
I have some Macbinary files on a PC. I want to recursively read these
files and remove the first 128 bytes of the files if they contain the
macbinary header info. I know how to read...
|
by: Jeff Thies |
last post by:
I need a quick way to count linebreaks. This is slug slow:
function findLinebreaks(str) {
var re='/\r\n|\n|\r\|\f/g';
var i=0;
while(re.match(str)){
i++;}
return i;
}
|
by: Stefan Landgraf |
last post by:
Hi there!
How can i replace linebreaks with <br> in datalist output ?
Is there a way i can do that in the aspx page itself without having
to go through the code page?
Thanks
Stefan
|
by: caspardh |
last post by:
i was trying to code a morse code decipherer which workd fine except that the .txt file that i was converting had linebreaks built in, i cant get python to ignore the line breaks and i cant find any...
|
by: peter |
last post by:
I have a xslt that writes a txt file from xml. Xml file is generated by
a user input on a webpage and some nodes have linebreaks which corrupts
my output. is there a way to generally set that xslt...
|
by: =?Utf-8?B?TXJOb2JvZHk=?= |
last post by:
I want to match some HTML string using Regex but the linebreaks are getting me.
Is there a way to just completely ignore linebreaks in my regular expression?
If not, how would I specify a...
|
by: rweth |
last post by:
I am using nntplib to download archived xml messages from our internal
newsgroup. This is working fine except the download of files to the
connected server, has extra embedded
lines in them (all...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |