Changing '&' to '+' in an xml file
Hi guys,
I was wondering how i would go about changing all occurences of the character '&' with a plus sign ('+') instead. This because i am downloading several xml files and storing the information at each node in a Database. Now because i am using .net compact framework 2 windows mobile 5 and am unable to use the .Usemneumonics property to allow an ampersand character to display. So i have decided to change every ampersand to a plus sign but because i dont know exactly where it could appear in the xml file i'd need to go through the whole file and change the character.
How can i got about doing this?
Thanks in advance for any help
:afrog:
Re: Changing '&' to '+' in an xml file
Replace command
VB Code:
Dim strTest As String = "&&&&&&&"
MessageBox.Show(strTest.Replace("&", "+"))
)
Re: Changing '&' to '+' in an xml file
Yeah i know that but is there anyway to do that before the xml file is inserted in the database?
So it kind of goes:
download xml file -> search xml file for '&' -> if exists replace with '+' -> insert into database.
Its just the 2nd and 3rd step i need to know.
Thanks. :thumb:
Re: Changing '&' to '+' in an xml file
After you download it, read it into a string, perform the replace and save it. Then import it.